cURL / Mailing Lists / curl-library / Single Mail


Re: Problem: Receiving data from Server

From: Daniel Stenberg <>
Date: Thu, 1 Nov 2001 15:28:47 +0100 (MET)

On Thu, 1 Nov 2001, Shailesh Mittal wrote:

> On client in VisualC++ how do I receive this data. I do NOT want to write
> this data to a file on client rather I want to keep it in memory for
> further processing. Please suggest which option in "curl_easy_setopt ()"
> I should use and how to actuall get the data in memory.

I wrote this example source that does exactly this. It is even included in
the release archive's docs/example section:

It is also mentioned and described on item 5.2 in the FAQ.

> Similarly, if I send some Header data (e.g. CONNECTION_ID=200 etc.) from
> the server, how do I receive it on client. Again, I do NOT want to write
> the header data to a file .

CURLOPT_HEADERFUNCTION sets the callback that gets called with all full
header lines as arguments, one by one. Set a pointer with CURLOPT_WRITEHEADER
to receive that as the fourth argument in the callback, it is very useful if
you wanna pass local stuff to the callback.

    Daniel Stenberg -- curl groks URLs --
Received on 2001-11-01