diff options
| author | Philip Douglas | 2013-07-04 05:29:42 -0700 |
|---|---|---|
| committer | Philip Douglas | 2013-07-04 05:29:42 -0700 |
| commit | bf8e71c455a47a53898f8239ac7dad47e5f1d53a (patch) | |
| tree | 967055f41f43a35b8d9362f47c81aad5af4036d3 /docs/api-guide/responses.md | |
| parent | fa9f5fb8dcf6d51b2db70d4e2a991779b056d1d4 (diff) | |
| parent | 5fa100245cbf71a47c7a1ea7a869d03049380130 (diff) | |
| download | django-rest-framework-bf8e71c455a47a53898f8239ac7dad47e5f1d53a.tar.bz2 | |
Merge pull request #1 from tomchristie/master
Update from main
Diffstat (limited to 'docs/api-guide/responses.md')
| -rw-r--r-- | docs/api-guide/responses.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/api-guide/responses.md b/docs/api-guide/responses.md index f83b8194..399b7c23 100644 --- a/docs/api-guide/responses.md +++ b/docs/api-guide/responses.md @@ -10,7 +10,7 @@ REST framework supports HTTP content negotiation by providing a `Response` class The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialised with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content. -There's no requirement for you to use the `Response` class, you can also return regular `HttpResponse` objects from your views if you want, but it provides a nicer interface for returning Web API responses. +There's no requirement for you to use the `Response` class, you can also return regular `HttpResponse` or `StreamingHttpResponse` objects from your views if required. Using the `Response` class simply provides a nicer interface for returning content-negotiated Web API responses, that can be rendered to multiple formats. Unless you want to heavily customize REST framework for some reason, you should always use an `APIView` class or `@api_view` function for views that return `Response` objects. Doing so ensures that the view can perform content negotiation and select the appropriate renderer for the response, before it is returned from the view. |
