I am trying to receive body parameters from ajax call without using async on backend route.
When doing async It is working fine:
@app.post('/process-form')
async def process_form(request : Request):
# Access form data
form_data = await request.body()
da = jsonable_encoder(form_data)
print(da)
But without async body() does not exist (vs code debugger) and it is awaitable or something:
@app.post('/process-form')
def process_form(request : Request):
# Access form data
form_data = request.body()
da = jsonable_encoder(form_data)
print(da)
site-packages\anyio\streams\memory.py", line 89, in receive_nowait
raise WouldBlock
anyio.WouldBlock
Why is it so and how Could I receive my data from request?