Curl http_code 狀態碼 意義及信息


shell命令:curl -I -m 10 -o /dev/null -s -w %{http_code} http://test.com


curl_init — 初始化一個curl會話
curl_copy_handle — 拷貝一個curl連接資源的所有內容和參數
curl_errno — 返回一個包含當前會話錯誤信息的數字編號
curl_error — 返回一個包含當前會話錯誤信息的字符串
curl_exec — 執行一個curl會話
curl_getinfo — 獲取一個curl連接資源句柄的信息
curl_multi_init — 初始化一個curl批處理句柄資源
curl_multi_add_handle — 向curl批處理會話中添加單獨的curl句柄資源
curl_multi_close — 關閉一個批處理句柄資源
curl_multi_exec — 解析一個curl批處理句柄
curl_multi_getcontent — 返回獲取的輸出的文本流
curl_multi_info_read — 獲取當前解析的curl的相關傳輸信息
curl_multi_remove_handle — 移除curl批處理句柄資源中的某個句柄資源
curl_multi_select — Get all the sockets associated with the cURL extension, which can then be "selected"
curl_setopt_array — 以數組的形式為一個curl設置會話參數
curl_setopt — 為一個curl設置會話參數
curl_version — 獲取curl相關的版本信息
curl_close — 關閉一個curl會話


curl爬取過程中,會返回一個http_code,下面是他們的意義信息
$http_code["0"]="Unable to access";
$http_code["100"]="Continue";
$http_code["101"]="Switching Protocols";
$http_code["200"]=”OK”;
$http_code["201"]=”Created”;
$http_code["202"]=”Accepted”;
$http_code["203"]=”Non-Authoritative Information”;
$http_code["204"]=”No Content”;
$http_code["205"]=”Reset Content”;
$http_code["206"]=”Partial Content”;
$http_code["300"]=”Multiple Choices”;
$http_code["301"]=”Moved Permanently”;
$http_code["302"]=”Found”;
$http_code["303"]=”See Other”;
$http_code["304"]=”Not Modified”;
$http_code["305"]=”Use Proxy”;
$http_code["306"]=”(Unused)”;
$http_code["307"]=”Temporary Redirect”;
$http_code["400"]=”Bad Request”;
$http_code["401"]=”Unauthorized”;
$http_code["402"]=”Payment Required”;
$http_code["403"]=”Forbidden”;
$http_code["404"]=”Not Found”;
$http_code["405"]=”Method Not Allowed”;
$http_code["406"]=”Not Acceptable”;
$http_code["407"]=”Proxy Authentication Required”;
$http_code["408"]=”Request Timeout”;
$http_code["409"]=”Conflict”;
$http_code["410"]=”Gone”;
$http_code["411"]=”Length Required”;
$http_code["412"]=”Precondition Failed”;
$http_code["413"]=”Request Entity Too Large”;
$http_code["414"]=”Request-URI Too Long”;
$http_code["415"]=”Unsupported Media Type”;
$http_code["416"]=”Requested Range Not Satisfiable”;
$http_code["417"]=”Expectation Failed”;
$http_code["500"]=”Internal Server Error”;
$http_code["501"]=”Not Implemented”;
$http_code["502"]=”Bad Gateway”;
$http_code["503"]=”Service Unavailable”;
$http_code["504"]=”Gateway Timeout”;
$http_code["505"]=”HTTP Version Not Supported”;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM