cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Simple (?) HTTP transfer and recieving question

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 29 May 2003 14:39:13 -0700

On Thu, May 29, 2003 at 04:58:50PM -0400, Joel Apter wrote:
> I am writing an application and am using libcurl solely for its HTTP
> interaction. I have some XML data that I need to send via HTTP to a server and
> need to receive the server's response. Currently I have my data url encoded in
> a c style string (char *) and POST it via a curl_easy_setopt(curl,
> CURLOPT_POSTFIELDS, xml_data) function call. The problem is that the response
> from the server that is echoed to stdout (need some help getting this into a
> string) is that the server could not validate the xml properly (the response is
> also in xml). I'm pretty sure the HTTP header has to have Content-Type: text/
> xml. Is there any way to change the content type in the header? Also, can
> someone show me a way to store the data received from the server into a string?
> Thanks in advance for any help.

RTFM. curl_easy_setopt(3) CURLOPT_WRITEFUNCTION and CURLOPT_HTTPHEADER

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
Received on 2003-05-29