mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Adding support for RFC 4918 status codes (#4291)
* Added HTTP status codes from RFC 4918 * Updated documentation about status codes * Added reference to RFC 4918
This commit is contained in:
parent
3ca0b15b17
commit
da2ff1bc4a
|
@ -50,6 +50,7 @@ This class of status code indicates that the client's request was successfully r
|
|||
HTTP_204_NO_CONTENT
|
||||
HTTP_205_RESET_CONTENT
|
||||
HTTP_206_PARTIAL_CONTENT
|
||||
HTTP_207_MULTI_STATUS
|
||||
|
||||
## Redirection - 3xx
|
||||
|
||||
|
@ -86,6 +87,9 @@ The 4xx class of status code is intended for cases in which the client seems to
|
|||
HTTP_415_UNSUPPORTED_MEDIA_TYPE
|
||||
HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE
|
||||
HTTP_417_EXPECTATION_FAILED
|
||||
HTTP_422_UNPROCESSABLE_ENTITY
|
||||
HTTP_423_LOCKED
|
||||
HTTP_424_FAILED_DEPENDENCY
|
||||
HTTP_428_PRECONDITION_REQUIRED
|
||||
HTTP_429_TOO_MANY_REQUESTS
|
||||
HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE
|
||||
|
@ -101,6 +105,7 @@ Response status codes beginning with the digit "5" indicate cases in which the s
|
|||
HTTP_503_SERVICE_UNAVAILABLE
|
||||
HTTP_504_GATEWAY_TIMEOUT
|
||||
HTTP_505_HTTP_VERSION_NOT_SUPPORTED
|
||||
HTTP_507_INSUFFICIENT_STORAGE
|
||||
HTTP_511_NETWORK_AUTHENTICATION_REQUIRED
|
||||
|
||||
## Helper functions
|
||||
|
|
|
@ -3,6 +3,7 @@ Descriptive HTTP status codes, for code readability.
|
|||
|
||||
See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
|
||||
And RFC 6585 - http://tools.ietf.org/html/rfc6585
|
||||
And RFC 4918 - https://tools.ietf.org/html/rfc4918
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
@ -36,6 +37,7 @@ HTTP_203_NON_AUTHORITATIVE_INFORMATION = 203
|
|||
HTTP_204_NO_CONTENT = 204
|
||||
HTTP_205_RESET_CONTENT = 205
|
||||
HTTP_206_PARTIAL_CONTENT = 206
|
||||
HTTP_207_MULTI_STATUS = 207
|
||||
HTTP_300_MULTIPLE_CHOICES = 300
|
||||
HTTP_301_MOVED_PERMANENTLY = 301
|
||||
HTTP_302_FOUND = 302
|
||||
|
@ -62,6 +64,9 @@ HTTP_414_REQUEST_URI_TOO_LONG = 414
|
|||
HTTP_415_UNSUPPORTED_MEDIA_TYPE = 415
|
||||
HTTP_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416
|
||||
HTTP_417_EXPECTATION_FAILED = 417
|
||||
HTTP_422_UNPROCESSABLE_ENTITY = 422
|
||||
HTTP_423_LOCKED = 423
|
||||
HTTP_424_FAILED_DEPENDENCY = 424
|
||||
HTTP_428_PRECONDITION_REQUIRED = 428
|
||||
HTTP_429_TOO_MANY_REQUESTS = 429
|
||||
HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431
|
||||
|
@ -72,4 +77,5 @@ HTTP_502_BAD_GATEWAY = 502
|
|||
HTTP_503_SERVICE_UNAVAILABLE = 503
|
||||
HTTP_504_GATEWAY_TIMEOUT = 504
|
||||
HTTP_505_HTTP_VERSION_NOT_SUPPORTED = 505
|
||||
HTTP_507_INSUFFICIENT_STORAGE = 507
|
||||
HTTP_511_NETWORK_AUTHENTICATION_REQUIRED = 511
|
||||
|
|
Loading…
Reference in New Issue
Block a user