mirror of
https://github.com/django/django.git
synced 2024-12-26 11:06:07 +00:00
[4.2.x] Fixed #34556 -- Doc'd that StreamingHttpResponse accepts memoryviews and strings iterators.
Backport of 599f3e2cda
from main
This commit is contained in:
parent
dbe263751c
commit
ddccecee91
@ -1204,9 +1204,9 @@ The :class:`StreamingHttpResponse` is not a subclass of :class:`HttpResponse`,
|
|||||||
because it features a slightly different API. However, it is almost identical,
|
because it features a slightly different API. However, it is almost identical,
|
||||||
with the following notable differences:
|
with the following notable differences:
|
||||||
|
|
||||||
* It should be given an iterator that yields bytestrings as content. When
|
* It should be given an iterator that yields bytestrings, :class:`memoryview`,
|
||||||
serving under WSGI, this should be a sync iterator. When serving under ASGI,
|
or strings as content. When serving under WSGI, this should be a sync
|
||||||
this is should an async iterator.
|
iterator. When serving under ASGI, then it should be an async iterator.
|
||||||
|
|
||||||
* You cannot access its content, except by iterating the response object
|
* You cannot access its content, except by iterating the response object
|
||||||
itself. This should only occur when the response is returned to the client:
|
itself. This should only occur when the response is returned to the client:
|
||||||
|
Loading…
Reference in New Issue
Block a user