diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/request_response.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/request_response.txt b/docs/request_response.txt index 818c639d9a..fc78a3459b 100644 --- a/docs/request_response.txt +++ b/docs/request_response.txt @@ -304,6 +304,10 @@ Methods Instantiates an ``HttpResponse`` object with the given page content (a string) and MIME type. The ``DEFAULT_MIME_TYPE`` is ``"text/html"``. + **New in Django development version:** ``content`` can be an iterator + instead of a string. This iterator should return strings, and those strings + will be joined together to form the content of the response. + ``__setitem__(header, value)`` Sets the given header name to the given value. Both ``header`` and ``value`` should be strings. @@ -341,7 +345,12 @@ Methods ``get_content_as_string(encoding)`` Returns the content as a Python string, encoding it from a Unicode object - if necessary. + if necessary. **Removed in Django development version.** + +``content`` + **New in Django development version.** Returns the content as a Python + string, encoding it from a Unicode object if necessary. Note this is a + property, not a method, so use ``r.content`` instead of ``r.content()``. ``write(content)``, ``flush()`` and ``tell()`` These methods make an ``HttpResponse`` instance a file-like object. |
