curl-and-python

will pycurl solve this?

From: Wendell Turner <wendell_at_enflight.com>
Date: Sun, 22 Jun 2008 18:40:42 -0700

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.

The command line curl statements are:

   curl --dump-header hdr.txt http://somewhere.net/subdir/page1.html
   curl -b hdr.txt http://somewhere.net/subdir/page2.html
   curl -b hdr.txt -d "user=user&pw=password" http://somewhere.net/subdir/page3.html
   curl -b hdr.txt -d "dataFormatID=aaaa" http://somewhere.net/subdir/page4.html
   curl -b hdr.txt -d "data=stuffhere&action=Submit" http://somewhere.net/subdir/page5.html

This last one gets this response from the server:

   java.lang.RuntimeException: selectedDataFormatId required in Session

Q: Will converting to pycurl solve this problem? (Will it
maintain a persistent connection that semms to be what the
server wants?)

Q: What are the equivalent of '--dump-header hdr.txt' and
'-b hdr.txt' in pycurl? I tried some (what I though was
obvious) 'c.setopt(c.POSTFIELDS,...)', but those were not
successful.

Thanks,

Wendell

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