Package wsgiwapi :: Module reason_phrases
[frames] | no frames]

Source Code for Module wsgiwapi.reason_phrases

 1  # Copyright (c) 2009 Richard Boulton 
 2  # 
 3  # Permission is hereby granted, free of charge, to any person obtaining a copy 
 4  # of this software and associated documentation files (the "Software"), to deal 
 5  # in the Software without restriction, including without limitation the rights 
 6  # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
 7  # copies of the Software, and to permit persons to whom the Software is 
 8  # furnished to do so, subject to the following conditions: 
 9  # 
10  # The above copyright notice and this permission notice shall be included in 
11  # all copies or substantial portions of the Software. 
12  # 
13  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
14  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
15  # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
16  # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
17  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
18  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
19  # SOFTWARE. 
20  r"""List of HTTP status codes and reason phrases. 
21   
22  """ 
23  __docformat__ = "restructuredtext en" 
24   
25  # List of reason phrases copied from RFC2616 
26  # Note: these are byte strings, encoded in US-ASCII 
27  phrases = ( 
28             '100 Continue', 
29             '101 Switching Protocols', 
30             '200 OK', 
31             '201 Created', 
32             '202 Accepted', 
33             '203 Non-Authoritative Information', 
34             '204 No Content', 
35             '205 Reset Content', 
36             '206 Partial Content', 
37             '300 Multiple Choices', 
38             '301 Moved Permanently', 
39             '302 Found (Object moved temporarily)', 
40             '303 See Other', 
41             '304 Not modified', 
42             '305 Use Proxy', 
43             '307 Temporary Redirect', 
44             '400 Bad Request', 
45             '401 Unauthorized', 
46             '402 Payment Required', 
47             '403 Forbidden', 
48             '404 Not Found', 
49             '405 Method Not Allowed', 
50             '406 Not Acceptable', 
51             '407 Proxy Authentication Required', 
52             '408 Request Time-out', 
53             '409 Conflict', 
54             '410 Gone', 
55             '411 Length Required', 
56             '412 Precondition Failed', 
57             '413 Request Entity Too Large', 
58             '414 Request-URI Too Large', 
59             '415 Unsupported Media Type', 
60             '416 Requested range not satisfiable', 
61             '417 Expectation Failed', 
62             '500 Internal Server Error', 
63             '501 Not Implemented', 
64             '502 Bad Gateway', 
65             '503 Service Unavailable', 
66             '504 Gateway Time-out', 
67             '505 HTTP Version not supported', 
68             ) 
69   
70  # Lookup phrases by response code. 
71  phrase_dict = dict((int(phrase[:3]), phrase) for phrase in phrases) 
72   
73  # vim: set fileencoding=utf-8 : 
74