django-extras / docs / ref / http-response.txt

Diff from to

docs/ref/http-response.txt

 -----------------------
 
 Django extras includes a number of additional ``HttpResponse`` subclasses
-that handle different types of HTTP responses. These subclasses live in
+that handle different types of HTTP responses. These subclasses are defined in
 :mod:`django_extras.http`.
 
+
+Common HTTP response types
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Common response codes, most of these codes are defined in the
+`W3C Protocol specification`_. This collection also includes status codes that
+are defined for Web DAV. This list does not include response types that are
+already defined in Django.
+
+.. _W3C Protocol specification: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+
+
+*Successful 2xx responses*
+
+.. class:: HttpResponseCreated
+
+    Status code 201
+
+.. class:: HttpResponseAccepted
+
+    Status code 202
+
+.. class:: HttpResponseNonAuthoritative
+
+    Status code 203
+
+.. class:: HttpResponseNoContent
+
+    Status code 204
+
+.. class:: HttpResponseResetContent
+
+    Status code 205
+
+.. class:: HttpResponsePartialContent
+
+    Status code 206
+
+
+*Redirection 3xx responses*
+
+All responses within the 3xx class inherit from :class:`HttpResponseRedirect`.
+
+.. class:: HttpResponseSeeOther
+
+    Status code 303
+
+
+*Client Error 4xx responses*
+
 .. class:: HttpResponseUnAuthorised
 
-    The constructor doesn't take any arguments. Use this to designate that a
-    logged in user does not have authorisation to access this URL (status code
-    401).
+    Status code 401
+
+.. class:: HttpResponsePaymentRequired
+
+    Status code 402
+
+.. class:: HttpResponseNotAcceptable
+
+    Status code 406
+
+.. class:: HttpResponseRequestTimeout
+
+    Status code 408
 
 .. class:: HttpResponseConflict
 
-    The constructor doesn't take any arguments. Use this to designate that a
-    request could not be completed due to a conflict with the current resource
-    state (status code 409).
+    Status code 409
+
+.. class:: HttpResponseLengthRequired
+
+    Status code 411
+
+.. class:: HttpResponsePreconditionFailed
+
+    Status code 412
+
+.. class:: HttpResponseRequestEntityTooLarge
+
+    Status code 413
+
+.. class:: HttpResponseUnsupportedMediaType
+
+    Status code 415
+
+.. class:: HttpResponseExpectationFailed
+
+    Status code 417
+
+.. class:: HttpResponseUnprocessableEntity
+
+    Status code 422
+
+.. class:: HttpResponseLocked
+
+    Status code 423
+
+.. class:: HttpResponseFailedDependency
+
+    Status code 424
+
+.. class:: HttpResponseUpgradeRequired
+
+    Status code 426
+
+
+*Server Error 5xx responses*
 
 .. class:: HttpResponseNotImplemented
 
-    The constructor doesn't take any arguments. Use this to indicate that the
-    application does not support the functionality required to fulfill the
-    request (status code 501).
+    Status code 501
+
+.. class:: HttpResponseBadGateway
+
+    Status code 502
+
+.. class:: HttpResponseServiceUnavailable
+
+    Status code 503
 
 .. class:: HttpResponseGatewayTimeout
 
-    The constructor doesn't take any arguments. Use this to indicate that the
-    request could not be completed due to a timeout connecting to an auxiliary
-    service (status code 504). This could be a request to a web service.
+    Status code 504
+
+.. class:: HttpResponseInsufficientStorage
+
+    status_code = 507
+
+
+Enhanced response types
+~~~~~~~~~~~~~~~~~~~~~~~
 
 .. class:: FileResponse
 
     The constructor accepts the same ``content`` property as the default
     :class:``HttpResponse`` class except it is interpreted as a file name or
-    file handle and a ``content_type`` and facilitates streaming the content
-    to the client. There is also an optional parameter
-    ``include_last_modified`` that defaults to *True* that will pass through
-    a last modified date of the specified file.
+    file handle and ``content_type``. The response object facilitates streaming
+    the content of the file to the client. There is an optional parameter
+    ``include_last_modified`` which defaults to *True* that supplies the
+    last modified date of the specified file as an HTTP header.
 
 .. class:: JsonResponse
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.