I see now that url-encoded and multiform are completely different methods. I'm 
trying to pass file, with two params, as I can see each param should be a 
separate section in multipart. The question is whether it's possible (and how) 
to set a param with curl_formadd(...) in such a way that that param will be 
accessible by POST[param] on server. 

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Daniel Stenberg
Sent: Friday, December 23, 2011 12:27 AM
To: libcurl development
Subject: Re: CURLOPT_HTTPPOST + CURLOPT_POSTFIELDS

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

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to