Using FastAPI in a sync way, how can I get the raw body of a POST request?
Using async def endpoint If an object is a co-routine, it needs to be awaited. FastAPI is actually Starlette underneath, and Starlette methods for returning the request body are async methods (see the source code here as well); thus, one needs to await them (inside an async def endpoint). For example: from fastapi import Request … Read more