make use of raw text

This commit is contained in:
Ludwig Lehnert 2025-02-14 21:12:35 +01:00
parent 07026dfc37
commit 99c32e6561

View File

@ -11,9 +11,10 @@ def read_root():
@app.post("/")
async def receive_data(request: Request):
data = await request.json()
print(data)
return {"received_data": data}
data = await request.body()
str_data = data.decode('utf-8')
print(str_data)
return {"received_data": str_data}
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)