cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: how to use libcurl to post

From: Jeff Pohlmeyer <yetanothergeek_at_yahoo.com>
Date: Sat, 14 Jun 2003 21:20:07 -0700 (PDT)

I want to write a program to upload something using HTTP POST, but failed.
 
here is the source code of html file:
[snip]

The curl_formadd() is for use with "multipart/formdata" (rfc1867) posts.
Looking at your HTML form, it looks like you want to use the standard
"application/x-www-form-urlencoded" POST instead. To do this, you don't
need curl_formadd() at all, instead you want to use the CURLOPT_POST
and CURLOPT_POSTFIELDS options to curl_easy_set_opt().

Something like this:

curl_easy_set_opt(curl, CURLOPT_POST, 1);
curl_easy_set_opt(curl, CURLOPT_POSTFIELDS, "vname=linux&kind=mu");

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-06-15