make use of raw text
This commit is contained in:
parent
07026dfc37
commit
99c32e6561
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user