cURL / Mailing Lists / curl-library / Single Mail

curl-library

cant resolve host on visual studio 2013

From: Azat Manukyan <livingfordead_at_gmail.com>
Date: Tue, 3 Mar 2015 01:47:31 +0400

hi,
how it can be that in windows visual studio 2013 curl_easy_perform returns
cannot_resolve host but same code in same pc works fine in ubuntu virtual
machine ? I'm using 7.41 version of libcurl.
thanks in advance .

here is the code

CURL *curl;
curl_global_init(CURL_GLOBAL_SSL);
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
curl_easy_setopt(curl, CURLOPT_URL, "https://myhost.com/api/login/");
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);// calculate request
headerstruct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "{\"username\":\"name\",
\"password\":\"test\"}" );
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_callback); // set callback

curl_easy_perform(curl); // perform request
curl_easy_cleanup(curl); // cleanup requestreturn 0;

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-02