http协议以及http1.0和http1.1的区别
Posted 阿里山QQ
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了http协议以及http1.0和http1.1的区别相关的知识,希望对你有一定的参考价值。
header响应头信息:
HTTP/1.1 302 FOUND Content-Length: 0 Set-Cookie: sessionid=n3gozvqbjba1zckr7v0ccj6yn7v96oh8; expires=Tue, 21-Mar-2017 02:57:34 GMT; httponly; Max-Age=300; Path=/ Vary: Cookie Server: TornadoServer/4.3 Location: http://jumpserver.i.beebank.com/ X-Frame-Options: SAMEORIGIN Content-Type: text/html; charset=utf-8
header请求头信息:
POST /login/ HTTP/1.1 Host: jumpserver.i.beebank.com Connection: keep-alive Content-Length: 47 Cache-Control: max-age=0 Origin: http://jumpserver.i.beebank.com Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Content-Type: application/x-www-form-urlencoded Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Referer: http://jumpserver.i.beebank.com/login/ Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8,en;q=0.6 Cookie: csrftoken=VwENAPzCENfcXVmw6tCBjTvQ2d99n1jU; sessionid=pwk41j162z9yr6go4fi97zxnulmrrcfn
http1.0使用keep-alive告知server端需要建立一个长连接,而http1.1默认支持长连接;
http1.1一开始只发送header信息,如果server返回200,表示有权限访问,然后才发送body信息,如果server返回401,表示该请求没有权限,就不会发送body的信息;
http1.1支持host域;
以上是关于http协议以及http1.0和http1.1的区别的主要内容,如果未能解决你的问题,请参考以下文章