summaryrefslogtreecommitdiff
path: root/docs/request_response.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-04-09 23:54:34 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-04-09 23:54:34 +0000
commitbc4638d722c0e48cfd6bc4d8084b41445f987004 (patch)
tree3fa74811a9275d242c8f4808571abd95fe801e74 /docs/request_response.txt
parentb0a60c186ee2a5564b5fa897b994e4ff2b7ad5b2 (diff)
Fixed #1569 -- HttpResponse now accepts iterators. Thanks, Maniac
git-svn-id: http://code.djangoproject.com/svn/django/trunk@2639 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/request_response.txt')
-rw-r--r--docs/request_response.txt11
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.