Upadte documentation for streaming response

This commit is contained in:
andreymal 2019-04-20 23:37:45 +03:00
parent 03855d316b
commit 6be12ba773
No known key found for this signature in database
GPG Key ID: CB605DA977D27A93
2 changed files with 4 additions and 0 deletions

View File

@ -60,6 +60,8 @@ async def index(request):
return response.stream(streaming_fn, content_type='text/plain')
```
See [Streaming](streaming.md) for more information.
## File Streaming
For large files, a combination of File and Streaming above
```python

View File

@ -117,3 +117,5 @@ async def index(request):
return stream(stream_from_db)
```
If a client supports HTTP/1.1, Sanic will use [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding); you can explicitly enable or disable it using `chunked` option of the `stream` function.