Skip to content
Discussion options

You must be logged in to vote

You could just make your requests in streaming mode and not read the content. https://www.python-httpx.org/quickstart/#streaming-responses

The last example in that section of the docs is basically your use case:

>>> with httpx.stream("GET", "https://www.example.com") as r:
...     if r.headers['Content-Length'] < TOO_LONG:
...         r.read()
...         print(r.text)

Replies: 1 comment

Comment options

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