cURL / Mailing Lists / curl-library / Single Mail

curl-library

How can I setup the http request header in libcurl? And how to check the http response code?

From: ying lcs <yinglcs_at_gmail.com>
Date: Thu, 12 Jul 2007 17:19:25 -0500

I have the following code to load a url using libcurl:

 /* init the curl session */
  curl_handle = curl_easy_init();

  /* specify URL to get */
  curl_easy_setopt(curl_handle, CURLOPT_URL,
"http://127.0.0.1/apache2-default/index.html");

  curl_easy_perform(curl_handle);

  /* cleanup curl stuff */
  curl_easy_cleanup(curl_handle);

can you please tell me how to specify HTTP request header? And how can
I check just the response code for the response?

Thank you.
Received on 2007-07-13