1
/*****************************************************************************
3
* Project ___| | | | _ \| |
5
* | (__| |_| | _ <| |___
6
* \___|\___/|_| \_\_____|
8
* $Id: getinfo.c,v 1.2 2004/11/22 16:24:46 bagder Exp $
12
#include <curl/curl.h>
19
/* http://curl.haxx.se/libcurl/c/curl_easy_init.html */
20
curl = curl_easy_init();
22
/* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
23
curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
24
/* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
25
res = curl_easy_perform(curl);
29
/* ask for the content-type */
30
/* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
31
res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
33
if((CURLE_OK == res) && ct)
34
printf("We received Content-Type: %s\n", ct);
38
/* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */
39
curl_easy_cleanup(curl);