curl-and-python

Re: pycurl and rest PUT interface

From: Mark Seger <mjseger_at_gmail.com>
Date: Tue, 22 Jan 2013 19:52:10 -0500

I finally figured it out, just had to dig deeper. I guess the secret it to
have the callback pass back pieces of the string and when it's done simply
return a null string. works like a champ!

So now one more question and this is for bonus points. When I do an upload
of a big string, I'm taking on the order of 100MB, I end up using
something like 90% of a CPU. Is this overhead being caused by ssl
compression and if so is there a way to turn it off? Any other thoughts on
why the overhead would be so high?

-mark

On Tue, Jan 22, 2013 at 5:33 PM, Mark Seger <mjseger_at_gmail.com> wrote:

> 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-23