class documentation

class codes(IntEnum):

View In Hierarchy

HTTP status codes and reason phrases

Status codes from the following RFCs are all observed:

  • RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
  • RFC 6585: Additional HTTP Status Codes
  • RFC 3229: Delta encoding in HTTP
  • RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518
  • RFC 5842: Binding Extensions to WebDAV
  • RFC 7238: Permanent Redirect
  • 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
  • RFC 8297: An HTTP Status Code for Indicating Hints
  • RFC 8470: Using Early Data in HTTP
Class Method get​_reason​_phrase Undocumented
Class Method is​_client​_error Returns True for 4xx status codes, False otherwise.
Class Method is​_error Returns True for 4xx or 5xx status codes, False otherwise.
Class Method is​_informational Returns True for 1xx status codes, False otherwise.
Class Method is​_redirect Returns True for 3xx status codes, False otherwise.
Class Method is​_server​_error Returns True for 5xx status codes, False otherwise.
Class Method is​_success Returns True for 2xx status codes, False otherwise.
Method __new__ Undocumented
Method __str__ Undocumented
Constant ACCEPTED Undocumented
Constant ALREADY​_REPORTED Undocumented
Constant BAD​_GATEWAY Undocumented
Constant BAD​_REQUEST Undocumented
Constant CONFLICT Undocumented
Constant CONTINUE Undocumented
Constant CREATED Undocumented
Constant EARLY​_HINTS Undocumented
Constant EXPECTATION​_FAILED Undocumented
Constant FAILED​_DEPENDENCY Undocumented
Constant FORBIDDEN Undocumented
Constant FOUND Undocumented
Constant GATEWAY​_TIMEOUT Undocumented
Constant GONE Undocumented
Constant HTTP​_VERSION​_NOT​_SUPPORTED Undocumented
Constant IM​_A​_TEAPOT Undocumented
Constant IM​_USED Undocumented
Constant INSUFFICIENT​_STORAGE Undocumented
Constant INTERNAL​_SERVER​_ERROR Undocumented
Constant LENGTH​_REQUIRED Undocumented
Constant LOCKED Undocumented
Constant LOOP​_DETECTED Undocumented
Constant METHOD​_NOT​_ALLOWED Undocumented
Constant MISDIRECTED​_REQUEST Undocumented
Constant MOVED​_PERMANENTLY Undocumented
Constant MULTI​_STATUS Undocumented
Constant MULTIPLE​_CHOICES Undocumented
Constant NETWORK​_AUTHENTICATION​_REQUIRED Undocumented
Constant NO​_CONTENT Undocumented
Constant NON​_AUTHORITATIVE​_INFORMATION Undocumented
Constant NOT​_ACCEPTABLE Undocumented
Constant NOT​_EXTENDED Undocumented
Constant NOT​_FOUND Undocumented
Constant NOT​_IMPLEMENTED Undocumented
Constant NOT​_MODIFIED Undocumented
Constant OK Undocumented
Constant PARTIAL​_CONTENT Undocumented
Constant PAYMENT​_REQUIRED Undocumented
Constant PERMANENT​_REDIRECT Undocumented
Constant PRECONDITION​_FAILED Undocumented
Constant PRECONDITION​_REQUIRED Undocumented
Constant PROCESSING Undocumented
Constant PROXY​_AUTHENTICATION​_REQUIRED Undocumented
Constant REQUEST​_ENTITY​_TOO​_LARGE Undocumented
Constant REQUEST​_HEADER​_FIELDS​_TOO​_LARGE Undocumented
Constant REQUEST​_TIMEOUT Undocumented
Constant REQUEST​_URI​_TOO​_LONG Undocumented
Constant REQUESTED​_RANGE​_NOT​_SATISFIABLE Undocumented
Constant RESET​_CONTENT Undocumented
Constant SEE​_OTHER Undocumented
Constant SERVICE​_UNAVAILABLE Undocumented
Constant SWITCHING​_PROTOCOLS Undocumented
Constant TEMPORARY​_REDIRECT Undocumented
Constant TOO​_EARLY Undocumented
Constant TOO​_MANY​_REQUESTS Undocumented
Constant UNAUTHORIZED Undocumented
Constant UNAVAILABLE​_FOR​_LEGAL​_REASONS Undocumented
Constant UNPROCESSABLE​_ENTITY Undocumented
Constant UNSUPPORTED​_MEDIA​_TYPE Undocumented
Constant UPGRADE​_REQUIRED Undocumented
Constant USE​_PROXY Undocumented
Constant VARIANT​_ALSO​_NEGOTIATES Undocumented
@classmethod
def get_reason_phrase(cls, value):

Undocumented

Parameters
value:intUndocumented
Returns
strUndocumented
@classmethod
def is_client_error(cls, value):
Returns True for 4xx status codes, False otherwise.
Parameters
value:intUndocumented
Returns
boolUndocumented
@classmethod
def is_error(cls, value):
Returns True for 4xx or 5xx status codes, False otherwise.
Parameters
value:intUndocumented
Returns
boolUndocumented
@classmethod
def is_informational(cls, value):
Returns True for 1xx status codes, False otherwise.
Parameters
value:intUndocumented
Returns
boolUndocumented
@classmethod
def is_redirect(cls, value):
Returns True for 3xx status codes, False otherwise.
Parameters
value:intUndocumented
Returns
boolUndocumented
@classmethod
def is_server_error(cls, value):
Returns True for 5xx status codes, False otherwise.
Parameters
value:intUndocumented
Returns
boolUndocumented
@classmethod
def is_success(cls, value):
Returns True for 2xx status codes, False otherwise.
Parameters
value:intUndocumented
Returns
boolUndocumented
def __new__(cls, value, phrase=''):

Undocumented

Parameters
value:intUndocumented
phrase:strUndocumented
Returns
codesUndocumented
def __str__(self):

Undocumented

Returns
strUndocumented
ACCEPTED: tuple =

Undocumented

Value
(202, 'Accepted')
ALREADY_REPORTED: tuple =

Undocumented

Value
(208, 'Already Reported')
BAD_GATEWAY: tuple =

Undocumented

Value
(502, 'Bad Gateway')
BAD_REQUEST: tuple =

Undocumented

Value
(400, 'Bad Request')
CONFLICT: tuple =

Undocumented

Value
(409, 'Conflict')
CONTINUE: tuple =

Undocumented

Value
(100, 'Continue')
CREATED: tuple =

Undocumented

Value
(201, 'Created')
EARLY_HINTS: tuple =

Undocumented

Value
(103, 'Early Hints')
EXPECTATION_FAILED: tuple =

Undocumented

Value
(417, 'Expectation Failed')
FAILED_DEPENDENCY: tuple =

Undocumented

Value
(424, 'Failed Dependency')
FORBIDDEN: tuple =

Undocumented

Value
(403, 'Forbidden')
FOUND: tuple =

Undocumented

Value
(302, 'Found')
GATEWAY_TIMEOUT: tuple =

Undocumented

Value
(504, 'Gateway Timeout')
GONE: tuple =

Undocumented

Value
(410, 'Gone')
HTTP_VERSION_NOT_SUPPORTED: tuple =

Undocumented

Value
(505, 'HTTP Version Not Supported')
IM_A_TEAPOT: tuple =

Undocumented

Value
(418, 'I\'m a teapot')
IM_USED: tuple =

Undocumented

Value
(226, 'IM Used')
INSUFFICIENT_STORAGE: tuple =

Undocumented

Value
(507, 'Insufficient Storage')
INTERNAL_SERVER_ERROR: tuple =

Undocumented

Value
(500, 'Internal Server Error')
LENGTH_REQUIRED: tuple =

Undocumented

Value
(411, 'Length Required')
LOCKED: tuple =

Undocumented

Value
(423, 'Locked')
LOOP_DETECTED: tuple =

Undocumented

Value
(508, 'Loop Detected')
METHOD_NOT_ALLOWED: tuple =

Undocumented

Value
(405, 'Method Not Allowed')
MISDIRECTED_REQUEST: tuple =

Undocumented

Value
(421, 'Misdirected Request')
MOVED_PERMANENTLY: tuple =

Undocumented

Value
(301, 'Moved Permanently')
MULTI_STATUS: tuple =

Undocumented

Value
(207, 'Multi-Status')
MULTIPLE_CHOICES: tuple =

Undocumented

Value
(300, 'Multiple Choices')
NETWORK_AUTHENTICATION_REQUIRED: tuple =

Undocumented

Value
(511, 'Network Authentication Required')
NO_CONTENT: tuple =

Undocumented

Value
(204, 'No Content')
NON_AUTHORITATIVE_INFORMATION: tuple =

Undocumented

Value
(203, 'Non-Authoritative Information')
NOT_ACCEPTABLE: tuple =

Undocumented

Value
(406, 'Not Acceptable')
NOT_EXTENDED: tuple =

Undocumented

Value
(510, 'Not Extended')
NOT_FOUND: tuple =

Undocumented

Value
(404, 'Not Found')
NOT_IMPLEMENTED: tuple =

Undocumented

Value
(501, 'Not Implemented')
NOT_MODIFIED: tuple =

Undocumented

Value
(304, 'Not Modified')
OK: tuple =

Undocumented

Value
(200, 'OK')
PARTIAL_CONTENT: tuple =

Undocumented

Value
(206, 'Partial Content')
PAYMENT_REQUIRED: tuple =

Undocumented

Value
(402, 'Payment Required')
PERMANENT_REDIRECT: tuple =

Undocumented

Value
(308, 'Permanent Redirect')
PRECONDITION_FAILED: tuple =

Undocumented

Value
(412, 'Precondition Failed')
PRECONDITION_REQUIRED: tuple =

Undocumented

Value
(428, 'Precondition Required')
PROCESSING: tuple =

Undocumented

Value
(102, 'Processing')
PROXY_AUTHENTICATION_REQUIRED: tuple =

Undocumented

Value
(407, 'Proxy Authentication Required')
REQUEST_ENTITY_TOO_LARGE: tuple =

Undocumented

Value
(413, 'Request Entity Too Large')
REQUEST_HEADER_FIELDS_TOO_LARGE: tuple =

Undocumented

Value
(431, 'Request Header Fields Too Large')
REQUEST_TIMEOUT: tuple =

Undocumented

Value
(408, 'Request Timeout')
REQUEST_URI_TOO_LONG: tuple =

Undocumented

Value
(414, 'Request-URI Too Long')
REQUESTED_RANGE_NOT_SATISFIABLE: tuple =

Undocumented

Value
(416, 'Requested Range Not Satisfiable')
RESET_CONTENT: tuple =

Undocumented

Value
(205, 'Reset Content')
SEE_OTHER: tuple =

Undocumented

Value
(303, 'See Other')
SERVICE_UNAVAILABLE: tuple =

Undocumented

Value
(503, 'Service Unavailable')
SWITCHING_PROTOCOLS: tuple =

Undocumented

Value
(101, 'Switching Protocols')
TEMPORARY_REDIRECT: tuple =

Undocumented

Value
(307, 'Temporary Redirect')
TOO_EARLY: tuple =

Undocumented

Value
(425, 'Too Early')
TOO_MANY_REQUESTS: tuple =

Undocumented

Value
(429, 'Too Many Requests')
UNAUTHORIZED: tuple =

Undocumented

Value
(401, 'Unauthorized')
UNAVAILABLE_FOR_LEGAL_REASONS: tuple =

Undocumented

Value
(451, 'Unavailable For Legal Reasons')
UNPROCESSABLE_ENTITY: tuple =

Undocumented

Value
(422, 'Unprocessable Entity')
UNSUPPORTED_MEDIA_TYPE: tuple =

Undocumented

Value
(415, 'Unsupported Media Type')
UPGRADE_REQUIRED: tuple =

Undocumented

Value
(426, 'Upgrade Required')
USE_PROXY: tuple =

Undocumented

Value
(305, 'Use Proxy')
VARIANT_ALSO_NEGOTIATES: tuple =

Undocumented

Value
(506, 'Variant Also Negotiates')