curl-and-python

Re: will pycurl solve this?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 23 Jun 2008 09:05:52 +0200 (CEST)

On Sun, 22 Jun 2008, Wendell Turner wrote:

> I can use curl from the command line to login to a site, and
> get past several POST pages, but I finally get an error that
> seems to be related to the this issue:
> Note that curl cannot use persistent connections for
> transfers that are used in subsequence curl invokes.

I find this very very unlikely. What makes you draw this conclusion? HTTP is
entirely stateless and the only violation in normal use is the NTLM
authenticaton and I don't see you use that. Persistent connection or not is
most likely not at all your problem.

Bad POST data, bad cookie handling or insufficient "user-agent-forging"
headers are much more likely to be your issue.

But yes, using pycurl you can make most if not all requests using the same
persistent connection.

> Q: What are the equivalent of '--dump-header hdr.txt' and '-b hdr.txt' in
> pycurl?

The general trick is to run the curl command with "--libcurl dump.c" to see
the C version of the command line, and writing the pycurl version from that
should be fairly trivial.

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2008-06-23