A RuntimeError: Stream consumed
error is raised when request.body()
is read in the custom middleware
#2556
Unanswered
theredfoxlee
asked this question in
Potential Issue
Replies: 1 comment 12 replies
-
I believe it's a bug. May I move it to the issues? |
Beta Was this translation helpful? Give feedback.
12 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I encountered the following issue while using Starlette today :)
Issue description
A
RuntimeError: Stream consumed
error is raised whenrequest.body()
is read in the custom middleware (1) aftercall_next
, given that a route usesrequest.body()
.How to reproduce the issue?
Code
Dependencies
Commands
uvicorn example:app
curl -XPUT http://127.0.0.1:8000 -d '123'
Known workarounds
request.body()
at least once beforecall_next
to ensure that the_body
is cached.This is my first time using
starlette
. Is this usage incorrect, or is it a bug?Beta Was this translation helpful? Give feedback.
All reactions