If (curl)
{
//remote URL, support HTTP, HTTPS, FTP
Curl_easy_setopt (curl, CURLOPT_URL, strURL c_str ());
Curl_easy_setopt (curl, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT6.0) ");
//the official download a DLL doesn't support GZIP, Accept - Encoding: deflate, GZIP
//curl_easy_setopt (curl, CURLOPT_ENCODING, "gzip, deflate");
Curl_easy_setopt (curl, CURLOPT_VERBOSE, 1 l);//debugging information open
//HTTPS access dedicated: start
Curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 0);
Curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 0);
//sets the content type at the HTTP send JSON
Curl_slist * slist=curl_slist_append (NULL,
"The content-type: application/json");
If (strContentType=="json")
Curl_easy_setopt (curl, CURLOPT_HTTPHEADER, slist);
Curl_easy_setopt (curl, CURLOPT_HTTPAUTH CURLAUTH_ANY);
/* */POST data
Curl_easy_setopt (curl, CURLOPT_POSTFIELDS, strPostData c_str ());
Curl_easy_setopt (curl, CURLOPT_POST, true);
//set the redirect the maximum times
Curl_easy_setopt (curl, CURLOPT_MAXREDIRS, 5);
//set 301302 jump follow the location
Curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
//grab headers, the callback function
Curl_easy_setopt (curl, CURLOPT_HEADERFUNCTION callback_header_func);
Curl_easy_setopt (curl, CURLOPT_HEADERDATA, & amp; M_strHeaderData);
//scraping content, the callback function
Curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION callback_wirte_func);
Curl_easy_setopt (curl, CURLOPT_WRITEDATA, & amp; M_strWriteData);
Curl_easy_setopt (curl, CURLOPT_VERBOSE, 1);
CURLcode code=curl_easy_perform (curl);
If (CURLE_OK==code)
{
Code=curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, & amp; LRet);
If (CURLE_OK==code & amp; & LRet==200)
{
StrRet=m_strWriteData;
}
}
The else {
}
//release the memory
Curl_slist_free_all (slist);/* free the list again */
Curl_easy_cleanup (curl);
}
CodePudding user response:
No one pay attention to?CodePudding user response:
SSL connection error, that run on the system did not support HTTPS/SSL DLLs, install the IIS or Apache web server software has built-in IIS on the high version of Windows, so you can run normalCodePudding user response: