curl-and-python
Re: Is there a way to use form_stream in pycurl?
Date: Fri, 5 Sep 2014 21:18:20 +0200
IIRC, you cannot really pass multiple file objects to pycurl.
Besides of you do pass a file object to pycurl, it has to be a real
os-level thing, that is with a file descriptor.
Thus you have only 2 options left - format entire post in Python (streamed
or not); or keep all post fields in memory.
D.
On 5 Sep 2014 19:05, "Tonhão - Antonio Brasolin" <tonhoanhon_at_gmail.com>
wrote:
> Hi.
>
> I've started using pycurl recently and am currently using the setop
> pycurl.FORM_FILE. But the data that i want to send is in a string, so it is
> weird to write a file just so the next method can read it.
>
> So my doubt is: is there an alternative to pycurl.FORM_FILE that takes
> either a string to be sent or a stream object (like a file object)?
>
> readdata and readfunction won't work for post with multi-part form.
>
> Thanks in advance,
> Antonio
>
> --
> El Psy Congroo,
> Antonio Añon Brasolin,
> Masters Degree Student in Universidade Federal de São Carlos
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2014-09-05