Lesson Eleven libcurl use and precautions

experience

1) can be quickly generated with Postman example code


2) curl_global_init initialization
if curl library function call when no calls curl_global_init carried curl global variable initialization, will curl_easy_init function, an initialization call


3) When the requested data, should carry on the return packet format, or can not return valid data
 struct curl_slist * pCurlHeadList = NULL;
 pCurlHeadList = curl_slist_append (pCurlHeadList, "Content-of the type: the Application / json");
 curl_easy_setopt (pCurlHandle , CURLOPT_HTTPHEADER, pCurlHeadList);
currently docked in the back end of the ASP pages, you must specify the transport format text


Guess you like

Origin blog.51cto.com/fengyuzaitu/2435680