C:\Python27\python.exe D:/git/Python/bookDay/api/http/httplipTest.py
状态的状态码:200是否请求Ok:
OK
header是多少:
[('content-length', '14613'), ('set-cookie', 'BAIDUID=5BE300935709382ADC6AFA01D08E1959:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com, BIDUPSID=5BE300935709382ADC6AFA01D08E1959; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com, PSTM=1481724972; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com'), ('accept-ranges', 'bytes'), ('vary', 'Accept-Encoding'), ('server', 'BWS/1.1'), ('last-modified', 'Mon, 12 Dec 2016 06:09:00 GMT'), ('connection', 'Keep-Alive'), ('x-ua-compatible', 'IE=Edge,chrome=1'), ('pragma', 'no-cache'), ('cache-control', 'no-cache'), ('date', 'Wed, 14 Dec 2016 14:16:12 GMT'), ('p3p', 'CP=" OTI DSP COR IVA OUR IND COM "'), ('content-type', 'text/html')]
Response消息结构:
Date: Wed,14 Dec 2016 14:16:12GMT
Content-Type: text/html
Content-Length: 14613Last-Modified: Mon, 12 Dec 2016 06:09:00GMT
Connection: Keep-Alive
Vary: Accept-Encoding
Set-Cookie: BAIDUID=5BE300935709382ADC6AFA01D08E1959:FG=1; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BIDUPSID=5BE300935709382ADC6AFA01D08E1959; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: PSTM=1481724972; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
P3P: CP="OTI DSP COR IVA OUR IND COM"Server: BWS/1.1X-UA-Compatible: IE=Edge,chrome=1Pragma: no-cache
Cache-control: no-cache
Accept-Ranges: bytes
响应内容:
百度一下,你就知道©2014 Baidu 使用百度前必读 京ICP证030173号
Process finished with exit code 0