curl-and-python

Re: equivalent to -d in pycurl

From: Michael Wood <esiotrot_at_gmail.com>
Date: Fri, 18 Nov 2011 09:21:19 +0200

Hi

On 18 November 2011 08:14, Joe <joe_at_shellblade.net> wrote:
> Eric Seubert wrote on 2011-11-18 12:27:
>> I am new to pycurl but have used the command line version of cURL in the past.  How do I replicate the -d command in pycurl?
>
> check out --libcurl - it spits out C source code for using libcurl with
> the parameters you give curl on the command line - it's awesome!

To expand on what Joe said, just add "--libcurl example.c" on the end
of your "curl" command line and it will produce a C program that does
the same thing as the "curl" command.

Then look at the curl_easy_setopt() calls in example.c to see what
options you need to use in the Python script.

-- 
Michael Wood <esiotrot_at_gmail.com>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2011-11-18