Get a request using PyCurl after logging in

After I made an entry to enter my site, I will try to get to my site, and I get a bunch of garbage "0` &) 붋 .... "instead of data from my site. Why is this? How to fix it?

+1
source share
1 answer

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.

+4
source

All Articles