Curious why await request.get_json() returns None with chunked transfer encoding but await request.data works? #360
Unanswered
space88man
asked this question in
Q&A
Replies: 1 comment
-
The most likely possibility to me is that the client does not set the JSON mimetype. What happens if you do |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Situation: client POST'ing using chunked transfer encoding. with either uvicorn/hypercorn frontend with a Quart ASGI app.
When I use
await request.get_json()
it always returnsNone
butawait request.data
will work andget the full payload. I can't control the client ATM.
Is this the expected behaviour?
I'm actually ok with
json.loads(...request.data...)
but curious about the difference in behaviour - if it matters the payload is normally very small and completed in the first chunk.Beta Was this translation helpful? Give feedback.
All reactions