diff options
| author | SaJH <wogur981208@gmail.com> | 2024-09-11 21:23:23 +0900 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-10-16 11:52:22 +0200 |
| commit | 4a685bc0dca5298a7d5a4e162120a90cac7fd1a4 (patch) | |
| tree | 4ecc8f20d0fc48c0a95e13e02a91b7eec8a20fb0 /docs/ref/request-response.txt | |
| parent | ec7d69035a408b357f1803ca05a7c991cc358cfa (diff) | |
Fixed #35727 -- Added HttpResponse.text property.
Signed-off-by: SaJH <wogur981208@gmail.com>
Diffstat (limited to 'docs/ref/request-response.txt')
| -rw-r--r-- | docs/ref/request-response.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 31111a435a..afebd00d8b 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -833,6 +833,13 @@ Attributes A bytestring representing the content, encoded from a string if necessary. +.. attribute:: HttpResponse.text + + .. versionadded:: 5.2 + + A string representation of :attr:`HttpResponse.content`, decoded using the + response's :attr:`HttpResponse.charset` (defaulting to ``UTF-8`` if empty). + .. attribute:: HttpResponse.cookies A :py:obj:`http.cookies.SimpleCookie` object holding the cookies included @@ -1272,6 +1279,9 @@ with the following notable differences: :attr:`~StreamingHttpResponse.streaming_content` attribute. This can be used in middleware to wrap the response iterable, but should not be consumed. +* It has no ``text`` attribute, as it would require iterating the response + object. + * You cannot use the file-like object ``tell()`` or ``write()`` methods. Doing so will raise an exception. |
