curl-users
Re: Libcurl -> HTTP POST Question
Date: Tue, 09 Jul 2002 16:26:20 -0400
> Nick Parsons wrote:
> Looking through the options available for the curl_east_setopt() function,
> I noticed the option CURLOPT_POSTFIELDS. This seems to be what I need
> for my program. The only problem with it is that it expects a char * for
> the parameter. I have a file with xml tags/data in it that I want to send,
> not a character buffer. I know that I can just read from the file into
> a character buffer and then send that but is that necessary?
Nick,
If I understand what you are asking, you may need to parse the XML
into name/value pairs, and add as a URL-encoded string. Or you can
add each pair as part of a multi-part form.
Other options:
- use a name such as "xml_data" and set the value to that of the entire file
- upload the file
I suppose it depends on what you want to do with the XML file on the
server side.
Chris
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Stuff, things, and much much more.
http://thinkgeek.com/sf
Received on 2002-07-09