Skip to content

httpx.ReadError (anyio.BrokenResourceError) when sending large request (target dependant) #3067

Discussion options

You must be logged in to vote

The first thing to do here is simplify the example.

I started out by just removing the async, and checking I was getting the same results.
Then made the example as simple as possible.

Which is...

input = "X" * 1_000_000
httpx.post("https://google.com", json={"input": input})

Or, using a different client to test the behaviour...

input = "X" * 1_000_000
requests.post("https://google.com", json={"input": input})

The behavior is similar in both cases... sometimes you'll get a neatly formed 405 response. Other times the server outright closes the connection. The one thing that we could do here is aim to improve the error messaging, and make it more clear that the server closed the connection.

I…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Tomas2D
Comment options

@tomchristie
Comment options

Answer selected by tomchristie
@ducnvu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants