返回值例子:
{
"url":"http://xxx.xxx.xx/xxx/xxx",
"content_type":null, //下载内容的Content-Type:值,NULL表示服务器没有发送有效的Content-Type: header
"http_code":0, //最后一个收到的http代码
"header_size":0, //header部分的大小
"request_size":0, //在HTTP请求中有问题的请求大小
"filetime":-1, //远程获取文档时间,若无法获取值为-1
"ssl_verify_result":0, //通过设置CURLOPT_SSL_VERIFYPEER返回的SSL证书验证请求的结
"redirect_count":0,
"total_time":0, //最后一次传输所消耗的时间
"namelookup_time":0.000023, //名称解析所消耗的时间
"connect_time":0, //建立连接所消耗的时间
"pretransfer_time":0, //从建立连接到准备传输所使用的时间
"size_upload":0, //以字节为单位返回上传数据量的总值
"size_download":0, //以字节为单位返回下载数据量的总值
"speed_download":0, //平均下载速度
"speed_upload":0, //平均上传速度
"download_content_length":-1, //从Content-Length: field中读取的下载内容长度
"upload_content_length":-1, //上传内容大小的说明
"starttransfer_time":0, //从建立连接到开始传输所使用的的时间
"redirect_time":0, //在事务传输开始前重定向所使用的时间
"redirect_url":"",
"primary_ip":"124.243.219.160",
"certinfo":[]
}
Http_code状态码返回值:
[Informational 1xx]
100="Continue"
101="Switching Protocols"
[Successful 2xx]
200="OK"
201="Created"
202="Accepted"
203="Non-Authoritative Information"
204="No Content"
205="Reset Content"
206="Partial Content"
[Redirection 3xx]
300="Multiple Choices"
301="Moved Permanently"
302="Found"
303="See Other"
304="Not Modified"
305="Use Proxy"
306="(Unused)"
307="Temporary Redirect"
[Client Error 4xx]
400="Bad Request"
401="Unauthorized"
402="Payment Required"
403="Forbidden"
404="Not Found"
405="Method Not Allowed"
406="Not Acceptable"
407="Proxy Authentication Required"
408="Request Timeout"
409="Conflict"
410="Gone"
411="Length Required"
412="Precondition Failed"
413="Request Entity Too Large"
414="Request-URI Too Long"
415="Unsupported Media Type"
416="Requested Range Not Satisfiable"
417="Expectation Failed"
[Server Error 5xx]
500="Internal Server Error"
501="Not Implemented"
502="Bad Gateway"
503="Service Unavailable"
504="Gateway Timeout"
505="HTTP Version Not Supported"
网友评论