Obviously, a dead thread, but if someone else stumbles on it, funky-like data is most likely compressed using zlib or gzip. If you use pycurl, this should do the trick:
import pycurl ch = pycurl.Curl() ch.setopt(pycurl.URL, 'http://example.com') ch.setopt(pycurl.ENCODING, '') ch.perform()
Setting the ENCODING parameter to an empty line sets the “Accept-Encoding” headers to all encodings supported by libcurl and tells libcurl: to decode the response data. The OP probably set the headers manually, and libcurl did not expect encoded data.
Parker ault
source share