curl_easy_perform response返回码

curl_easy_perform返回值只表明此函数执行的情况,若要得到http response,必须在执行curl_easy_perform之后调用curl_easy_getinfo获取,例如:

1
2
3
4
long retcode = 0;
int ret = curl_easy_getinfo(_curlHandle, CURLINFO_RESPONSE_CODE , &retcode);
if ((CURLE_OK == ret) && retcode)
cout<<"response: "<<retcode<<endl;

Leave a Comment