curl-and-python

Re: curlpython without a file?

From: Brian Wawok <bwawok_at_gmail.com>
Date: Tue, 6 Apr 2010 16:07:26 -0500

So, kevins patch made pycurl work with strings. Yay. Now I am dying due to
socket limitations ;( any chance there is also a patch to make pycurl multi
work with strings as input?

On Apr 5, 2010 6:30 PM, "Brian Wawok" <bwawok_at_gmail.com> wrote:

I am trying to http post a file with cuyrlpython. I can get it to work
like this:

                   output = open("c:\\test.text", 'w')
                   output.write(postStr)
                   output.close()
                   c = pycurl.Curl()
                   c.setopt(c.POST, 1)
                   c.setopt(c.URL, completeUrl)
                   c.setopt(c.HTTPPOST, [("sc", (c.FORM_FILE,
'c:\\test.text') )])

But that is pretty silly. I have tried various variations of
StringIO.StringIO with no luck. How do I take my string and send it
along as my http file? Thanks a bunch!

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