diff options
author | Hynek Schlawack <hs@ox.cx> | 2012-05-16 07:51:07 (GMT) |
---|---|---|
committer | Hynek Schlawack <hs@ox.cx> | 2012-05-16 07:51:07 (GMT) |
commit | 51b2ed51f0cc18a69a1d53eb9f0f088c99681afc (patch) | |
tree | ef8f6e076a8a3324f0ca29fc5bc3609fcf389acd /Lib/http/client.py | |
parent | 313fbe21068038099cc4e57ae4bcd9e8a06e8b43 (diff) | |
download | cpython-51b2ed51f0cc18a69a1d53eb9f0f088c99681afc.zip cpython-51b2ed51f0cc18a69a1d53eb9f0f088c99681afc.tar.gz cpython-51b2ed51f0cc18a69a1d53eb9f0f088c99681afc.tar.bz2 |
#14809: Add HTTP status codes from RFC 6585 to http.server and http.client
Patch by EungJun Yi.
Diffstat (limited to 'Lib/http/client.py')
-rw-r--r-- | Lib/http/client.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py index 9c110d5..6089192 100644 --- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -141,6 +141,9 @@ UNPROCESSABLE_ENTITY = 422 LOCKED = 423 FAILED_DEPENDENCY = 424 UPGRADE_REQUIRED = 426 +PRECONDITION_REQUIRED = 428 +TOO_MANY_REQUESTS = 429 +REQUEST_HEADER_FIELDS_TOO_LARGE = 431 # server error INTERNAL_SERVER_ERROR = 500 @@ -151,6 +154,7 @@ GATEWAY_TIMEOUT = 504 HTTP_VERSION_NOT_SUPPORTED = 505 INSUFFICIENT_STORAGE = 507 NOT_EXTENDED = 510 +NETWORK_AUTHENTICATION_REQUIRED = 511 # Mapping status codes to official W3C names responses = { @@ -192,6 +196,9 @@ responses = { 415: 'Unsupported Media Type', 416: 'Requested Range Not Satisfiable', 417: 'Expectation Failed', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', 500: 'Internal Server Error', 501: 'Not Implemented', @@ -199,6 +206,7 @@ responses = { 503: 'Service Unavailable', 504: 'Gateway Timeout', 505: 'HTTP Version Not Supported', + 511: 'Network Authentication Required', } # maximal amount of data to read at one time in _safe_read |