Skip to content

iter_bytes raise ValueError when response body is empty #1819

Discussion options

You must be logged in to vote

Well caught, yup. I can also duplicate it without respx like so...

import httpx

transport = httpx.MockTransport(handler=lambda request: httpx.Response(204))
client = httpx.Client(transport=transport)
response = client.get('https://www.example.com/')
for chunk in response.iter_bytes():
    print(chunk)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tomchristie
Comment options

@tomchristie
Comment options

Answer selected by tomchristie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants