summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/request-response.txt27
-rw-r--r--docs/releases/1.8.txt4
2 files changed, 31 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 2a43756889..a86f416620 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -651,6 +651,12 @@ Attributes
This attribute exists so middleware can treat streaming responses
differently from regular responses.
+.. attribute:: HttpResponse.closed
+
+ .. versionadded:: 1.8
+
+ ``True`` if the response has been closed.
+
Methods
-------
@@ -769,6 +775,27 @@ Methods
This method makes an :class:`HttpResponse` instance a file-like object.
+.. method:: HttpResponse.getvalue()
+
+ .. versionadded:: 1.8
+
+ Returns the value of :attr:`HttpResponse.content`. This method makes
+ an :class:`HttpResponse` instance a stream-like object.
+
+.. method:: HttpResponse.writable()
+
+ .. versionadded:: 1.8
+
+ Always ``True``. This method makes an :class:`HttpResponse` instance a
+ stream-like object.
+
+.. method:: HttpResponse.writelines(lines)
+
+ .. versionadded:: 1.8
+
+ Writes a list of lines to the response. Line seperators are not added. This
+ method makes an :class:`HttpResponse` instance a stream-like object.
+
.. _HTTP status code: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10
.. _ref-httpresponse-subclasses:
diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt
index 492fad478f..00a2c9844c 100644
--- a/docs/releases/1.8.txt
+++ b/docs/releases/1.8.txt
@@ -385,6 +385,10 @@ Requests and Responses
<django.http.HttpRequest.get_full_path>` method now escapes unsafe characters
from the path portion of a Uniform Resource Identifier (URI) properly.
+* :class:`~django.http.HttpResponse` now implements a few additional methods
+ like :meth:`~django.http.HttpResponse.getvalue` so that instances can be used
+ as stream objects.
+
Tests
^^^^^