1 /*****************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
11 #include <curl/curl.h>
18 curl = curl_easy_init();
20 struct curl_slist *chunk = NULL;
22 chunk = curl_slist_append(chunk, "Accept: moo");
23 chunk = curl_slist_append(chunk, "Another: yes");
25 /* request with the built-in Accept: */
26 curl_easy_setopt(curl, CURLOPT_URL, "localhost");
27 curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
28 res = curl_easy_perform(curl);
30 /* redo request with our own custom Accept: */
31 res = curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
32 res = curl_easy_perform(curl);
35 curl_easy_cleanup(curl);