Lesson 14 using curl and precautions

1) curl_global_init initialization
if curl library function call when no calls curl_global_init curl initialized global variables, will curl_easy_init
function, an initialization call.

2) 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/2429036