Open creativcoder opened 4 years ago
Can you post the response headers? It kind of looks like gzip decoding is failing...
>>> r.headers
{'Date': 'Sat, 16 May 2020 18:33:13 GMT', 'Content-Length': '11', 'Content-Type': 'text/plain; charset=UTF-8', 'Server': 'tiny-http (Rust)'}
I got some similar error. It was because it was using proxy even for localhost connections. Setting the no_proxy
worked.
In Python's (3.5.2) requests:
Whereas in reqwest:
Fails with an error:
Use case: I am using reqwests as an HTTP client in a web scraper to scrape a page hosted on localhost. The page is hosted on localhost to provide a reproducible/imuutable test environment for the scraper.
If this is a bug, I would like to make a fix.