cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: behind the scenes of CURLOPT-commands?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 19 Nov 2010 12:39:13 -0800

On Fri, Nov 19, 2010 at 01:31:43PM +0100, Bobo Wieland wrote:
> I need to do the equivalent of the following php-code using cURL directly:
>
> $ch = curl_init($posturl);
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
> curl_setopt($ch, CURLOPT_HEADER, 1);
> curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
>
> I can't figure out everything and I can't find a guide online.
>
> CURLOPT_FOLLOWLOCATION == --location
> CURLOPT_SSL_VERIFYPEER == --insecure
> CURLOPT_POST == --header "Expect:" //some bug causing it to fail

CURLOPT_POST+CURLOPT_POSTFIELDS sounds more like -d or -F to me.

> otherwize(?)
> CURLOPT_HEADER == --include
> CURLOPT_RETURNTRANSFER == ???

I don't think this is relevant with curl. It always returns the right error
code on a failure.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-19