Echo request body back.
(request: Request)
| 129 | |
| 130 | @app.post("/echo") |
| 131 | async def echo(request: Request): |
| 132 | """Echo request body back.""" |
| 133 | body = await request.body() |
| 134 | content_type = request.headers.get("content-type", "application/octet-stream") |
| 135 | return Response(content=body, media_type=content_type) |
| 136 | |
| 137 | |
| 138 | @app.get("/headers") |