1CURL *curl = curl_easy_init();
2if(curl) {
3 CURLcode ret;
4 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
5 /* allow whatever auth the server speaks */
6 curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
7 curl_easy_setopt(curl, CURLOPT_USERPWD, "james:bond");
8 ret = curl_easy_perform(curl);
9}
10