FastAPI · Class
StreamingResponse
Use StreamingResponse to send strings or bytes in chunks. Yield each chunk from an async or synchronous generator, and FastAPI sends it without JSON conversion.
Last updated
- Since
- FastAPI 0.134.0
Syntax
StreamingResponse(content, status_code=200, headers=None, media_type=None, background=None)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
Stream JSON LinesServer-Sent Events (SSE)ResponseEventSourceResponseServerSentEvent