HTTTP协议
作者:互联网
request与response
1.request:
它有三部分:
- request: line
- request: headers
- request: body
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate, br Accept-Language: zh-CN,zh;q=0.9 Cache-Control: no-cache Connection: keep-alive Cookie: BIDUPSID=F311238F2C64BCC37F730DD4DD1CF121; BDUSS=zB5a3pwLThXTzh6Snd2cENRbVNYNDBodVF0aH********************************* Pragma: no-cache Referer: https://www.baidu.com/ Sec-Fetch-Dest: document Sec-Fetch-Mode: navigate Sec-Fetch-Site: same-origin Sec-Fetch-User: ?1 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0
一般都要有,它告诉服务器一些配制信息。而服务器用它判断是不是同一用户。
例如,用IE浏览器访问过,再用chrom访问时,换了访问用户,服务器要不拒绝,要不就重新发全部内容。(防止爬虫,检测是不是正常用户,还是程序访问)
Content-Type:
客户端告诉服务器,boby中的数据类型。
Accept-Encoding: gzip, deflate, br
告诉服务器,本地支持的解码方式
token和author----也可能用到
标签:协议,request,Accept,537.36,Sec,服务器,HTTTP,Fetch 来源: https://www.cnblogs.com/chihuo/p/15929935.html