Skip to content

Commit 9ac9c1b

Browse files
authored
Update status code docs (encode#6732)
1 parent 6a8575b commit 9ac9c1b

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs/api-guide/status-codes.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ The full set of HTTP status codes included in the `status` module is listed belo
2020
The module also includes a set of helper functions for testing if a status code is in a given range.
2121

2222
from rest_framework import status
23-
from rest_framework.test import APITestCase
23+
from rest_framework.test import APITestCase
2424

25-
class ExampleTestCase(APITestCase):
26-
def test_url_root(self):
27-
url = reverse('index')
28-
response = self.client.get(url)
29-
self.assertTrue(status.is_success(response.status_code))
25+
class ExampleTestCase(APITestCase):
26+
def test_url_root(self):
27+
url = reverse('index')
28+
response = self.client.get(url)
29+
self.assertTrue(status.is_success(response.status_code))
3030

3131

3232
For more information on proper usage of HTTP status codes see [RFC 2616][rfc2616]
@@ -51,6 +51,8 @@ This class of status code indicates that the client's request was successfully r
5151
HTTP_205_RESET_CONTENT
5252
HTTP_206_PARTIAL_CONTENT
5353
HTTP_207_MULTI_STATUS
54+
HTTP_208_ALREADY_REPORTED
55+
HTTP_226_IM_USED
5456

5557
## Redirection - 3xx
5658

@@ -64,6 +66,7 @@ This class of status code indicates that further action needs to be taken by the
6466
HTTP_305_USE_PROXY
6567
HTTP_306_RESERVED
6668
HTTP_307_TEMPORARY_REDIRECT
69+
HTTP_308_PERMANENT_REDIRECT
6770

6871
## Client Error - 4xx
6972

@@ -90,6 +93,7 @@ The 4xx class of status code is intended for cases in which the client seems to
9093
HTTP_422_UNPROCESSABLE_ENTITY
9194
HTTP_423_LOCKED
9295
HTTP_424_FAILED_DEPENDENCY
96+
HTTP_426_UPGRADE_REQUIRED
9397
HTTP_428_PRECONDITION_REQUIRED
9498
HTTP_429_TOO_MANY_REQUESTS
9599
HTTP_431_REQUEST_HEADER_FIELDS_TOO_LARGE
@@ -105,7 +109,11 @@ Response status codes beginning with the digit "5" indicate cases in which the s
105109
HTTP_503_SERVICE_UNAVAILABLE
106110
HTTP_504_GATEWAY_TIMEOUT
107111
HTTP_505_HTTP_VERSION_NOT_SUPPORTED
112+
HTTP_506_VARIANT_ALSO_NEGOTIATES
108113
HTTP_507_INSUFFICIENT_STORAGE
114+
HTTP_508_LOOP_DETECTED
115+
HTTP_509_BANDWIDTH_LIMIT_EXCEEDED
116+
HTTP_510_NOT_EXTENDED
109117
HTTP_511_NETWORK_AUTHENTICATION_REQUIRED
110118

111119
## Helper functions

0 commit comments

Comments
 (0)