From: Stephen Brown II Date: Mon, 22 Jul 2019 20:13:00 +0000 (-0500) Subject: Additional HTTP Status Codes 418, 451 (#135) X-Git-Tag: 0.6.8~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37df46a83b93a0f40f2b8e10282f6f038dd908f6;p=thirdparty%2Fhttpx.git Additional HTTP Status Codes 418, 451 (#135) --- diff --git a/httpx/status_codes.py b/httpx/status_codes.py index e7b15dfc..5fe37299 100644 --- a/httpx/status_codes.py +++ b/httpx/status_codes.py @@ -13,6 +13,8 @@ class StatusCode(IntEnum): * RFC 2295: Transparent Content Negotiation in HTTP * RFC 2774: An HTTP Extension Framework * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2) + * RFC 2324: Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0) + * RFC 7725: An HTTP Status Code to Report Legal Obstacles """ def __new__(cls, value: int, phrase: str = "") -> "StatusCode": @@ -101,6 +103,7 @@ class StatusCode(IntEnum): UNSUPPORTED_MEDIA_TYPE = 415, "Unsupported Media Type" REQUESTED_RANGE_NOT_SATISFIABLE = 416, "Requested Range Not Satisfiable" EXPECTATION_FAILED = 417, "Expectation Failed" + IM_A_TEAPOT = 418, "I'm a teapot" MISDIRECTED_REQUEST = 421, "Misdirected Request" UNPROCESSABLE_ENTITY = 422, "Unprocessable Entity" LOCKED = 423, "Locked" @@ -109,6 +112,7 @@ class StatusCode(IntEnum): PRECONDITION_REQUIRED = 428, "Precondition Required" TOO_MANY_REQUESTS = 429, "Too Many Requests" REQUEST_HEADER_FIELDS_TOO_LARGE = 431, "Request Header Fields Too Large" + UNAVAILABLE_FOR_LEGAL_REASONS = 451, "Unavailable For Legal Reasons" # server errors INTERNAL_SERVER_ERROR = 500, "Internal Server Error"