cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_HTTPPOST + CURLOPT_POSTFIELDS

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 22 Dec 2011 22:27:05 +0100 (CET)

On Thu, 22 Dec 2011, Eugeny Melamud wrote:

> As I find out I can't use both CURLOPT_HTTPPOST, CURLOPT_POSTFIELDS so if

Using both doesn't make any sense and just isn't possible.

HTTP POST is about sending data in the request body. Both these options cause
a POST to happen. They do offer two mutually exclusive ways to insert content
into the request body. You need to decide which way to use.

> curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
> how can I pass params to server (?name1=value1&name2=value2...)?

If you want to use a multipart formpost (CURLOPT_HTTPPOST) then you don't pass
on data as "name1=value1&name2=value2" in the POST at all.

I suspect you haven't quite understood what you're about to do.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-22