cURL / Mailing Lists / curl-library / Single Mail


How to extract a header value from a POST response

From: Javier Gálvez Guerrero <>
Date: Fri, 18 Mar 2011 11:16:33 +0100


I am writing a simple module that sends a POST message to a server and
extracts the value of the 'data' parameter of the response message.
Following the curl tutorial guidelines, I have implemented the POST message
sending like this:

send_data(CURL* curl, char* URL, char* data)
CURLcode res;

curl_easy_setopt(curl, CURLOPT_URL, URL);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)strlen(data));

res = curl_easy_perform(curl);

return res;

However, I do not know how to extract response headers. Should I set any
option to the easy handler? I have read the tutorial but I do not get any
answer to such issue. Any help would be really appreciated.

Thank you,

List admin:
Received on 2011-03-18