[Twisted-Python] Problem fetching page with getPage
ssteinerx at gmail.com
Sat Jan 2 10:03:16 EST 2010
On Jan 2, 2010, at 9:34 AM, Terry Jones wrote:
> In any case, it looks like the problem is not in the setup of the request.
> Can anyone offer a reason why httplib might be able to fetch the page
> whereas getPage receives an error? I'm stumped.
I've had to debug things like this recently and I have two suggestions:
1> Recreate the headers and make it work with curl. Curl won't add anything to your headers and such and you'll be sure that you're getting the result you want with completely stripped down case.
2> Get Charles http://www.charlesproxy.com/ if you're on OS X. It rocks. Otherwise, get one of the Windows tools (sorry, no recos from me on that), and watch exactly what goes by.
I had a situation where python's HTTPlib stuff was adding an Accept Encoding header that didn't put there, and it exposed a bug in the API I was using. When I ran it with curl, worked fine since no additional headers were added. Charles helped me see what was going on (unfortunately, long after they had fixed that particular bug in the API.
More information about the Twisted-Python