You can find nearly everything inside the Request
object
You are able to get request body with request.json()
, which will give you the parsed JSON as dictionary.
from fastapi import Request, FastAPI
@app.post("/dummypath")
async def get_body(request: Request):
return await request.json()
If you want access the body as string, you can use request.body()