Http协议报文结构

版权声明:如需转载,请附上原文链接即可 https://blog.csdn.net/doujinlong1/article/details/85053130

Http协议报文结构

Http请求

HTTP请求由状态行、请求头、请求正文三部分组成。

状态行包括:

Request URL: https://www.baidu.com/his?wd=&from=pc_web&rf=3&hisdata=%5B%7B%22time%22%3A1544595691%2C%22kw%22%3A%22%E5%8C%97%E5%A4%A7%E9%9D%92%E9%B8%9F%E5%A5%BD%E4%B8%8D%22%7D%2C%7B%22time%22%3A1544596340%2C%22kw%22%3A%22compute%22%7D%2C%7B%22time%22%3A1544597531%2C%22kw%22%3A%22oss%20%E8%B7%A8%E5%9F%9F%E4%B8%8D%E8%83%BD%E4%B8%8B%E8%BD%BD%22%7D%2C%7B%22time%22%3A1544597961%2C%22kw%22%3A%22%E5%9B%BE%E7%89%87%E9%93%BE%E6%8E%A5%E6%80%8E%E4%B9%88%E8%83%BD%E7%9B%B4%E6%8E%A5%E4%B8%8B%E8%BD%BD%22%7D%2C%7B%22time%22%3A1544598033%2C%22kw%22%3A%22%E5%9B%BE%E7%89%87%E9%93%BE%E6%8E%A5%E6%80%8E%E4%B9%88%E8%83%BD%E7%9B%B4%E6%8E%A5%E4%B8%8B%E8%BD%BD%E8%80%8C%E4%B8%8D%E6%9F%A5%E7%9C%8B%22%7D%2C%7B%22time%22%3A1544598668%2C%22kw%22%3A%22oss%20%E7%9B%B4%E6%8E%A5%E4%B8%8B%E8%BD%BD%E8%80%8C%E4%B8%8D%E6%89%93%E5%BC%80%22%7D%2C%7B%22time%22%3A1544599314%2C%22kw%22%3A%22%E5%BC%A0%E5%8D%AB%E5%81%A5%E5%85%89%E5%A4%B4%E5%8E%9F%E5%9B%A0%22%7D%2C%7B%22time%22%3A1544599597%2C%22kw%22%3A%22%E6%A8%8A%E5%B0%91%E7%9A%87%22%7D%2C%7B%22time%22%3A1544599995%2C%22kw%22%3A%22s666%22%7D%5D&json=1&p=3&sid=&req=2&csor=0&cb=jQuery110209511683153213772_1545037393284&_=1545037393285
Request Method: GET
Remote Address: 61.135.169.125:443
Referrer Policy: unsafe-url

请求头就是request Header:

Accept: text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9
Connection: keep-alive
Cookie: BAIDUID=DC9FAA61196BF99B4DD044981FEC51E1:FG=1; PSTM=1532160165; BIDUPSID=782529C27649EC9D3631E6516A1FB144; BD_UPN=12314753; sugstore=1; BDORZ=B490B5EBF6F3CD402E515D22BCDA1598; MCITY=-%3A; H_PS_PSSID=; H_PS_645EC=550c%2FEGBhJFJAP2%2B9EtolvWKT31Va6Cc01bpIew6YnfGrPqdocRibZebQNU; delPer=0; BD_CK_SAM=1; PSINO=2; BD_HOME=0
Host: www.baidu.com
Referer: https://www.baidu.com/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
X-Requested-With: XMLHttpRequest

请求正文就是真正请求的数据,get方法的参数,post方法的参数,form格式的参数等,如:

wd=&from=pc_web&rf=3&hisdata=fghdfghdfg&json=1&p=3&sid=&req=2&csor=0&cb=jQuery110209511683153213772_1545037393284&_=1545037393285

HTTP返回

由状态行、响应头、响应正文

状态行:

Status Code: 200 OK

响应头:

Cache-Control: private
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 346
Content-Type: baiduApp/json; v6.27.2.14; charset=UTF-8
Date: Mon, 17 Dec 2018 09:03:13 GMT
Expires: Mon, 17 Dec 2018 10:03:13 GMT
Server: suggestion.baidu.zbb.df

响应正文:

jQuery110209511683153213772_1545037393284({
"q": "",
"p": false,
"bs": "",
"csor": "0",
"g":
"s": []
});
展开阅读全文

没有更多推荐了,返回首页