Http status code with libcurl?
问题 How do I get the HTTP status code (eg 200 or 500) after calling curl_easy_perform? 回答1: http://curl.haxx.se/libcurl/c/curl_easy_getinfo.html CURLINFO_RESPONSE_CODE Pass a pointer to a long to receive the last received HTTP or FTP code. This option was known as CURLINFO_HTTP_CODE in libcurl 7.10.7 and earlier. This will be zero if no server response code has been received. Note that a proxy's CONNECT response should be read with CURLINFO_HTTP_CONNECTCODE and not this. curl_code = curl_easy