1 /*****************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
11 #include <curl/curl.h>
18 /* http://curl.haxx.se/libcurl/c/curl_easy_init.html */
19 curl = curl_easy_init();
21 /* http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTURL */
22 curl_easy_setopt(curl, CURLOPT_URL, "http://www.example.com/");
23 /* http://curl.haxx.se/libcurl/c/curl_easy_perform.html */
24 res = curl_easy_perform(curl);
28 /* ask for the content-type */
29 /* http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html */
30 res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct);
32 if((CURLE_OK == res) && ct)
33 printf("We received Content-Type: %s\n", ct);
37 /* http://curl.haxx.se/libcurl/c/curl_easy_cleanup.html */
38 curl_easy_cleanup(curl);