cURL / Mailing Lists / curl-library / Single Mail


Re: HTTP Headers in Response message.

From: Dan Fandrich <>
Date: Sat, 16 Mar 2013 21:52:35 +0100

On Sat, Mar 16, 2013 at 01:10:08AM -0400, Anil J wrote:
> In the libcurl tutorial, under section Customizing Operations, it is mentioned
> about how to manipulate the Headers in the Request message we can send using
> curl API. But I did not understood how we can handle the HTTP headers in the
> Response message coming from the server. 
> What if the application using curl API wants to check/read the HTTP headers in
> response message, and their values. The 'size_t write_data' function allows to
> read all the attachments of the message, but nothing is mentioned about the
> HTTP headers in the response message. 
> Can some one please elaborate a bit  on this?

The CURLOPT_HEADERFUNCTION callback can be used to get a copy of all the
headers as they are received. You can also use the curl_easy_getinfo() function
to retrieve parsed values from many of the common headers without having to
deal with raw headers yourself.

>>> Dan
List admin:
Received on 2013-03-16