Large response body.
(size: int = 1024)
| 175 | |
| 176 | @app.get("/large") |
| 177 | async def large(size: int = 1024): |
| 178 | """Large response body.""" |
| 179 | # Cap at 10MB for safety |
| 180 | size = min(size, 10 * 1024 * 1024) |
| 181 | return Response(content=b"x" * size, media_type="application/octet-stream") |
| 182 | |
| 183 | |
| 184 | @app.get("/delay") |