From fd1bee103ac922a74dd3a8103c7a41dc459a36a8 Mon Sep 17 00:00:00 2001 From: Gustavo Pantuza Coelho Pinto Date: Wed, 20 Jul 2016 22:55:43 -0300 Subject: [PATCH 1/3] Added HTTP status codes from RFC 4918 --- rest_framework/status.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rest_framework/status.py b/rest_framework/status.py index ed1b4784be..714f3221ba 100644 --- a/rest_framework/status.py +++ b/rest_framework/status.py @@ -36,6 +36,7 @@ def is_server_error(code): 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 +63,9 @@ def is_server_error(code): 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 +76,5 @@ def is_server_error(code): 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 From a78f68a7746e574b6bc8596dec3081d66e75fa39 Mon Sep 17 00:00:00 2001 From: Gustavo Pantuza Coelho Pinto Date: Wed, 20 Jul 2016 22:57:29 -0300 Subject: [PATCH 2/3] Updated documentation about status codes --- docs/api-guide/status-codes.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/api-guide/status-codes.md b/docs/api-guide/status-codes.md index 398c048049..f6ec3598fc 100644 --- a/docs/api-guide/status-codes.md +++ b/docs/api-guide/status-codes.md @@ -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 From 46a7062c9ade00c622de26739787181cdfc2f000 Mon Sep 17 00:00:00 2001 From: Gustavo Pantuza Coelho Pinto Date: Wed, 20 Jul 2016 22:59:39 -0300 Subject: [PATCH 3/3] Added reference to RFC 4918 --- rest_framework/status.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rest_framework/status.py b/rest_framework/status.py index 714f3221ba..c016b63c6c 100644 --- a/rest_framework/status.py +++ b/rest_framework/status.py @@ -3,6 +3,7 @@ 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 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy