aboutsummaryrefslogtreecommitdiffstats
path: root/docs/api-guide/responses.md
diff options
context:
space:
mode:
authorTom Christie2012-10-05 14:00:02 +0100
committerTom Christie2012-10-05 14:00:02 +0100
commit6a15556384c48984868493b6b38a7afa61d77a3a (patch)
tree62ce446d756b1d63edcbdb2cf188361bafe438e6 /docs/api-guide/responses.md
parent1a09983dfc2d7ac03f2722e054e04c300bf77e65 (diff)
downloaddjango-rest-framework-6a15556384c48984868493b6b38a7afa61d77a3a.tar.bz2
Docs tweaks
Diffstat (limited to 'docs/api-guide/responses.md')
-rw-r--r--docs/api-guide/responses.md8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/api-guide/responses.md b/docs/api-guide/responses.md
index d8f8e97c..724428f8 100644
--- a/docs/api-guide/responses.md
+++ b/docs/api-guide/responses.md
@@ -18,7 +18,9 @@ Unless you want to heavily customize REST framework for some reason, you should
# Methods
-## Response(data, status=None, template_name=None, headers=None)
+## Response()
+
+**Signature:** `Response(data, status=None, template_name=None, headers=None)`
Unlike regular `HttpResponse` objects, you do not instantiate `Response` objects with rendered content. Instead you pass in unrendered data, which may consist of any python primatives.
@@ -35,11 +37,13 @@ Arguments:
## .render()
+**Signature:** `.render()`
+
This methd is called to render the serialized data of the response into the final response content. When `.render()` is called, the response content will be set to the result of calling the `.render(data, accepted_media_type)` method on the accepted renderer instance.
You won't typically need to call `.render()` yourself, as it's handled by Django's standard response cycle.
-## Standard HTTPResponse methods
+## Standard response methods
The `Response` class extends `SimpleTemplateResponse`, and all the usual methods are also available on the response. For example you can set headers on the response in the standard way: