Replies: 1 comment
|
When using the HTTPX CLI, the httpx https://example.com/binary-endpoint --download output.binUnder the hood, HTTPX opens this file in binary write mode ( # httpx/_main.py:
for chunk in response.iter_bytes():
download.write(chunk)If you ran this and observed an ASCII text file instead of your expected binary stream, check for the two most common causes: 1. Cause: Server returned an HTTP error or HTML redirectBy default,
2. Cause: Piping stdout (
|
Uh oh!
There was an error while loading. Please reload this page.
If I do --download on the request it appears to generate an ascii encoded textfile, which is obviously not what I want, I want a real binary file. The response is an octet stream.
All reactions