curl-and-python

Re: pycurl and rest PUT interface

From: Mark Seger <mjseger_at_gmail.com>
Date: Tue, 22 Jan 2013 17:33:43 -0500

very cool, worked like a champ! so what if I now want to replace the file
contents with the contents of a variable? I was hoping I might be able to
replace the file reference to one to a variable, like this:

c.setopt(pycurl.READFUNCTION, string)

but I guess READFUNCTION doesn't take a string. is there some other option
that does?

-mark

On Tue, Jan 22, 2013 at 4:57 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Tue, 22 Jan 2013, Mark Seger wrote:
>
> ultimately I want to point to a string and say PUT but I'm happy to start
>> with something simpler.
>>
>
> Here's a pycurl example doing HTTP PUT:
>
> http://pycurl.cvs.sourceforge.**net/viewvc/pycurl/pycurl/**
> examples/file_upload.py?view=**markup<http://pycurl.cvs.sourceforge.net/viewvc/pycurl/pycurl/examples/file_upload.py?view=markup>
>
> A C example doing HTTP PUT looks like this:
>
> http://curl.haxx.se/libcurl/c/**httpput.html<http://curl.haxx.se/libcurl/c/httpput.html>
>
>
> --
>
> / daniel.haxx.se
> ______________________________**_________________
> http://cool.haxx.se/cgi-bin/**mailman/listinfo/curl-and-**python<http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2013-01-22