curl-and-python

curlpython without a file?

From: Brian Wawok <bwawok_at_gmail.com>
Date: Mon, 5 Apr 2010 18:30:53 -0500

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