Skip to content

Migrating from requests: stream=True in Client.request #3219

Answered by kchen
jamesbraza asked this question in Q&A
Discussion options

You must be logged in to vote

While I was searching the issues section previously, I had found #830, which indicates that the way to do this if you can't use with client.stream() is:

client = httpx.Client()
request = client.build_request("GET", url)
response = client.send(request, stream=True)

and then making sure to call response.close() when ready, since that will not be automatically handled.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tomchristie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants