码迷,mamicode.com
首页 > Web开发 > 详细

http协议以及http1.0和http1.1的区别

时间:2017-03-21 12:18:03      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:发送   flat   .com   content   origin   login   nec   log   cookie   

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的区别

标签:发送   flat   .com   content   origin   login   nec   log   cookie   

原文地址:http://www.cnblogs.com/cqq-20151202/p/6593590.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!