Upadte documentation for streaming response
This commit is contained in:
parent
03855d316b
commit
6be12ba773
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user