# Streaming Response

say it: **“STREE-ming rih-SPONS”** **/ˈstrimɪŋ rɪˈspɒns/**

Sends data in pieces as it is produced.

## What is **Streaming Response**?

A `StreamingResponse` sends data in pieces as it is produced, such as a large file or AI-generated text, instead of all at once.

```python
async def count():
    for n in range(10):
        yield f'{n}\n'

@app.get('/count')
def stream():
    return StreamingResponse(count(), media_type='text/plain')
```

Level: Freelancer · [More FastAPI terms at this level](https://www.ask-codey.com/glossary?category=fastapi&level=4)

Updated: November 17, 2026

Source: https://www.ask-codey.com/glossary/streaming-response
