Possible to read content without decoding it? #2900
-
|
IIUC httpx.Response().read()always decodes the content before reading in case it is able to: Lines 830 to 834 in e63b659 Is it possible to get the raw content, or rather |
Beta Was this translation helpful? Give feedback.
Answered by
karpetrosyan
Oct 25, 2023
Replies: 1 comment 1 reply
-
|
You can use iter_raw directly Like so: import httpx
with httpx.stream("GET", "https://www.youtube.com") as response:
print(response.headers['content-encoding']) # gzip
raw_content = b''.join(response.iter_raw()) # gziped content |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
pmeier
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use iter_raw directly
Like so: