gh-127089: Add missing description for codes in http.HTTPStatus
(#127100)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
This commit is contained in:
parent
0b5f1fae57
commit
71de839ec9
@ -54,8 +54,9 @@ class HTTPStatus:
|
|||||||
CONTINUE = 100, 'Continue', 'Request received, please continue'
|
CONTINUE = 100, 'Continue', 'Request received, please continue'
|
||||||
SWITCHING_PROTOCOLS = (101, 'Switching Protocols',
|
SWITCHING_PROTOCOLS = (101, 'Switching Protocols',
|
||||||
'Switching to new protocol; obey Upgrade header')
|
'Switching to new protocol; obey Upgrade header')
|
||||||
PROCESSING = 102, 'Processing'
|
PROCESSING = 102, 'Processing', 'Server is processing the request'
|
||||||
EARLY_HINTS = 103, 'Early Hints'
|
EARLY_HINTS = (103, 'Early Hints',
|
||||||
|
'Headers sent to prepare for the response')
|
||||||
|
|
||||||
# success
|
# success
|
||||||
OK = 200, 'OK', 'Request fulfilled, document follows'
|
OK = 200, 'OK', 'Request fulfilled, document follows'
|
||||||
@ -67,9 +68,11 @@ class HTTPStatus:
|
|||||||
NO_CONTENT = 204, 'No Content', 'Request fulfilled, nothing follows'
|
NO_CONTENT = 204, 'No Content', 'Request fulfilled, nothing follows'
|
||||||
RESET_CONTENT = 205, 'Reset Content', 'Clear input form for further input'
|
RESET_CONTENT = 205, 'Reset Content', 'Clear input form for further input'
|
||||||
PARTIAL_CONTENT = 206, 'Partial Content', 'Partial content follows'
|
PARTIAL_CONTENT = 206, 'Partial Content', 'Partial content follows'
|
||||||
MULTI_STATUS = 207, 'Multi-Status'
|
MULTI_STATUS = (207, 'Multi-Status',
|
||||||
ALREADY_REPORTED = 208, 'Already Reported'
|
'Response contains multiple statuses in the body')
|
||||||
IM_USED = 226, 'IM Used'
|
ALREADY_REPORTED = (208, 'Already Reported',
|
||||||
|
'Operation has already been reported')
|
||||||
|
IM_USED = 226, 'IM Used', 'Request completed using instance manipulations'
|
||||||
|
|
||||||
# redirection
|
# redirection
|
||||||
MULTIPLE_CHOICES = (300, 'Multiple Choices',
|
MULTIPLE_CHOICES = (300, 'Multiple Choices',
|
||||||
@ -128,15 +131,19 @@ class HTTPStatus:
|
|||||||
EXPECTATION_FAILED = (417, 'Expectation Failed',
|
EXPECTATION_FAILED = (417, 'Expectation Failed',
|
||||||
'Expect condition could not be satisfied')
|
'Expect condition could not be satisfied')
|
||||||
IM_A_TEAPOT = (418, 'I\'m a Teapot',
|
IM_A_TEAPOT = (418, 'I\'m a Teapot',
|
||||||
'Server refuses to brew coffee because it is a teapot.')
|
'Server refuses to brew coffee because it is a teapot')
|
||||||
MISDIRECTED_REQUEST = (421, 'Misdirected Request',
|
MISDIRECTED_REQUEST = (421, 'Misdirected Request',
|
||||||
'Server is not able to produce a response')
|
'Server is not able to produce a response')
|
||||||
UNPROCESSABLE_CONTENT = 422, 'Unprocessable Content'
|
UNPROCESSABLE_CONTENT = (422, 'Unprocessable Content',
|
||||||
|
'Server is not able to process the contained instructions')
|
||||||
UNPROCESSABLE_ENTITY = UNPROCESSABLE_CONTENT
|
UNPROCESSABLE_ENTITY = UNPROCESSABLE_CONTENT
|
||||||
LOCKED = 423, 'Locked'
|
LOCKED = 423, 'Locked', 'Resource of a method is locked'
|
||||||
FAILED_DEPENDENCY = 424, 'Failed Dependency'
|
FAILED_DEPENDENCY = (424, 'Failed Dependency',
|
||||||
TOO_EARLY = 425, 'Too Early'
|
'Dependent action of the request failed')
|
||||||
UPGRADE_REQUIRED = 426, 'Upgrade Required'
|
TOO_EARLY = (425, 'Too Early',
|
||||||
|
'Server refuses to process a request that might be replayed')
|
||||||
|
UPGRADE_REQUIRED = (426, 'Upgrade Required',
|
||||||
|
'Server refuses to perform the request using the current protocol')
|
||||||
PRECONDITION_REQUIRED = (428, 'Precondition Required',
|
PRECONDITION_REQUIRED = (428, 'Precondition Required',
|
||||||
'The origin server requires the request to be conditional')
|
'The origin server requires the request to be conditional')
|
||||||
TOO_MANY_REQUESTS = (429, 'Too Many Requests',
|
TOO_MANY_REQUESTS = (429, 'Too Many Requests',
|
||||||
@ -164,10 +171,14 @@ class HTTPStatus:
|
|||||||
'The gateway server did not receive a timely response')
|
'The gateway server did not receive a timely response')
|
||||||
HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported',
|
HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported',
|
||||||
'Cannot fulfill request')
|
'Cannot fulfill request')
|
||||||
VARIANT_ALSO_NEGOTIATES = 506, 'Variant Also Negotiates'
|
VARIANT_ALSO_NEGOTIATES = (506, 'Variant Also Negotiates',
|
||||||
INSUFFICIENT_STORAGE = 507, 'Insufficient Storage'
|
'Server has an internal configuration error')
|
||||||
LOOP_DETECTED = 508, 'Loop Detected'
|
INSUFFICIENT_STORAGE = (507, 'Insufficient Storage',
|
||||||
NOT_EXTENDED = 510, 'Not Extended'
|
'Server is not able to store the representation')
|
||||||
|
LOOP_DETECTED = (508, 'Loop Detected',
|
||||||
|
'Server encountered an infinite loop while processing a request')
|
||||||
|
NOT_EXTENDED = (510, 'Not Extended',
|
||||||
|
'Request does not meet the resource access policy')
|
||||||
NETWORK_AUTHENTICATION_REQUIRED = (511,
|
NETWORK_AUTHENTICATION_REQUIRED = (511,
|
||||||
'Network Authentication Required',
|
'Network Authentication Required',
|
||||||
'The client needs to authenticate to gain network access')
|
'The client needs to authenticate to gain network access')
|
||||||
|
@ -594,8 +594,9 @@ class BasicTest(TestCase):
|
|||||||
CONTINUE = 100, 'Continue', 'Request received, please continue'
|
CONTINUE = 100, 'Continue', 'Request received, please continue'
|
||||||
SWITCHING_PROTOCOLS = (101, 'Switching Protocols',
|
SWITCHING_PROTOCOLS = (101, 'Switching Protocols',
|
||||||
'Switching to new protocol; obey Upgrade header')
|
'Switching to new protocol; obey Upgrade header')
|
||||||
PROCESSING = 102, 'Processing'
|
PROCESSING = 102, 'Processing', 'Server is processing the request'
|
||||||
EARLY_HINTS = 103, 'Early Hints'
|
EARLY_HINTS = (103, 'Early Hints',
|
||||||
|
'Headers sent to prepare for the response')
|
||||||
# success
|
# success
|
||||||
OK = 200, 'OK', 'Request fulfilled, document follows'
|
OK = 200, 'OK', 'Request fulfilled, document follows'
|
||||||
CREATED = 201, 'Created', 'Document created, URL follows'
|
CREATED = 201, 'Created', 'Document created, URL follows'
|
||||||
@ -606,9 +607,11 @@ class BasicTest(TestCase):
|
|||||||
NO_CONTENT = 204, 'No Content', 'Request fulfilled, nothing follows'
|
NO_CONTENT = 204, 'No Content', 'Request fulfilled, nothing follows'
|
||||||
RESET_CONTENT = 205, 'Reset Content', 'Clear input form for further input'
|
RESET_CONTENT = 205, 'Reset Content', 'Clear input form for further input'
|
||||||
PARTIAL_CONTENT = 206, 'Partial Content', 'Partial content follows'
|
PARTIAL_CONTENT = 206, 'Partial Content', 'Partial content follows'
|
||||||
MULTI_STATUS = 207, 'Multi-Status'
|
MULTI_STATUS = (207, 'Multi-Status',
|
||||||
ALREADY_REPORTED = 208, 'Already Reported'
|
'Response contains multiple statuses in the body')
|
||||||
IM_USED = 226, 'IM Used'
|
ALREADY_REPORTED = (208, 'Already Reported',
|
||||||
|
'Operation has already been reported')
|
||||||
|
IM_USED = 226, 'IM Used', 'Request completed using instance manipulations'
|
||||||
# redirection
|
# redirection
|
||||||
MULTIPLE_CHOICES = (300, 'Multiple Choices',
|
MULTIPLE_CHOICES = (300, 'Multiple Choices',
|
||||||
'Object has several resources -- see URI list')
|
'Object has several resources -- see URI list')
|
||||||
@ -665,15 +668,19 @@ class BasicTest(TestCase):
|
|||||||
EXPECTATION_FAILED = (417, 'Expectation Failed',
|
EXPECTATION_FAILED = (417, 'Expectation Failed',
|
||||||
'Expect condition could not be satisfied')
|
'Expect condition could not be satisfied')
|
||||||
IM_A_TEAPOT = (418, 'I\'m a Teapot',
|
IM_A_TEAPOT = (418, 'I\'m a Teapot',
|
||||||
'Server refuses to brew coffee because it is a teapot.')
|
'Server refuses to brew coffee because it is a teapot')
|
||||||
MISDIRECTED_REQUEST = (421, 'Misdirected Request',
|
MISDIRECTED_REQUEST = (421, 'Misdirected Request',
|
||||||
'Server is not able to produce a response')
|
'Server is not able to produce a response')
|
||||||
UNPROCESSABLE_CONTENT = 422, 'Unprocessable Content'
|
UNPROCESSABLE_CONTENT = (422, 'Unprocessable Content',
|
||||||
|
'Server is not able to process the contained instructions')
|
||||||
UNPROCESSABLE_ENTITY = UNPROCESSABLE_CONTENT
|
UNPROCESSABLE_ENTITY = UNPROCESSABLE_CONTENT
|
||||||
LOCKED = 423, 'Locked'
|
LOCKED = 423, 'Locked', 'Resource of a method is locked'
|
||||||
FAILED_DEPENDENCY = 424, 'Failed Dependency'
|
FAILED_DEPENDENCY = (424, 'Failed Dependency',
|
||||||
TOO_EARLY = 425, 'Too Early'
|
'Dependent action of the request failed')
|
||||||
UPGRADE_REQUIRED = 426, 'Upgrade Required'
|
TOO_EARLY = (425, 'Too Early',
|
||||||
|
'Server refuses to process a request that might be replayed')
|
||||||
|
UPGRADE_REQUIRED = (426, 'Upgrade Required',
|
||||||
|
'Server refuses to perform the request using the current protocol')
|
||||||
PRECONDITION_REQUIRED = (428, 'Precondition Required',
|
PRECONDITION_REQUIRED = (428, 'Precondition Required',
|
||||||
'The origin server requires the request to be conditional')
|
'The origin server requires the request to be conditional')
|
||||||
TOO_MANY_REQUESTS = (429, 'Too Many Requests',
|
TOO_MANY_REQUESTS = (429, 'Too Many Requests',
|
||||||
@ -700,10 +707,14 @@ class BasicTest(TestCase):
|
|||||||
'The gateway server did not receive a timely response')
|
'The gateway server did not receive a timely response')
|
||||||
HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported',
|
HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported',
|
||||||
'Cannot fulfill request')
|
'Cannot fulfill request')
|
||||||
VARIANT_ALSO_NEGOTIATES = 506, 'Variant Also Negotiates'
|
VARIANT_ALSO_NEGOTIATES = (506, 'Variant Also Negotiates',
|
||||||
INSUFFICIENT_STORAGE = 507, 'Insufficient Storage'
|
'Server has an internal configuration error')
|
||||||
LOOP_DETECTED = 508, 'Loop Detected'
|
INSUFFICIENT_STORAGE = (507, 'Insufficient Storage',
|
||||||
NOT_EXTENDED = 510, 'Not Extended'
|
'Server is not able to store the representation')
|
||||||
|
LOOP_DETECTED = (508, 'Loop Detected',
|
||||||
|
'Server encountered an infinite loop while processing a request')
|
||||||
|
NOT_EXTENDED = (510, 'Not Extended',
|
||||||
|
'Request does not meet the resource access policy')
|
||||||
NETWORK_AUTHENTICATION_REQUIRED = (511,
|
NETWORK_AUTHENTICATION_REQUIRED = (511,
|
||||||
'Network Authentication Required',
|
'Network Authentication Required',
|
||||||
'The client needs to authenticate to gain network access')
|
'The client needs to authenticate to gain network access')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user