I want to create a FastAPI endpoint that just accepts an arbitrary post request body and returns it.
If I send {"foo" : "bar"} , I want to get {"foo" : "bar"} back. But I also want to be able to send {"foo1" : "bar1", "foo2" : "bar2"} and get that back.
I tried:
from fastapi import FastAPI
app = FastAPI()
app.post("/")
async def handle(request: BaseModel):
return request
But that returns an empty dictionary, no matter what I send it.
Any ideas?