HTTP1.1和HTTP1.0的区别
Persistent Connection(持久连接)
在HTTP1.0中,每对Request/Response都使用一个新的连接。
HTTP 1.1则 支持Persistent Connection,
?????????????????????
?
?
Entity Tags
???
用于Cache。
?
?
Range?和?Content-Range
?
HTTP1.1支持 传送内容的一部分。比方说,当客户端已经有内容的一部分,为了节省带宽,可以只向服务器请求一部分。
?
?
100 (Continue) Status
?
100 (Continue)?状态代码的使用,允许客户端在发request消 息body之前先用request header试探一下server,看server要不要接收request body,再决定要不要发request body。
客户端在Request头部中包含
Expect: 100-continue
Server看到之 后呢如果回100 (Continue)?这个状态 代码,客户端就继续发request body。
?
这个是HTTP1.1才有的。
?
?
Request method
?
HTTP1.1增加 了OPTIONS, PUT, DELETE, TRACE, CONNECT这 些Request方法.
?
???????Method?????????=?"OPTIONS"????????????????; Section 9.2
??????????????????????| "GET"????????????????????; Section 9.3
??????????????????????| "HEAD"???????????????????; Section 9.4
??????????????????????| "POST"???????????????????; Section 9.5
??????????????????????| "PUT"????????????????????; Section 9.6
??????????????????????| "DELETE"?????????????????; Section 9.7
??????????????????????| "TRACE"??????????????????; Section 9.8
??????????????????????| "CONNECT"????????????????; Section 9.9
??????????????????????| extension-method
???????extension-method = token
?
?
Status code
?
??HTTP1.1?增加的新的status code:
?
(HTTP1.0没有定义任何具体的1xx status code, HTTP1.1有2个)
100 Continue
101 Switching Protocols
?
203 Non-Authoritative Information
205 Reset Content
206 Partial Content
?
302 Found (在HTTP1.0中有个?302 Moved Temporarily)
303 See Other
305 Use Proxy
307 Temporary Redirect
?
405 Method Not Allowed
406 Not Acceptable
407 Proxy Authentication Required
408 Request Timeout
409 Conflict
410 Gone
411 Length Required
412 Precondition Failed
413 Request Entity Too Large
414 Request-URI Too Long
415 Unsupported Media Type
416 Requested Range Not Satisfiable
417 Expectation Failed
?
504 Gateway Timeout
505 HTTP Version Not Supported
?
?Content Negotiation
?
????HTTP1.1增加了Content Negotiation,分为Server-driven Negotiation,Agent-driven Negotiation和Transparent Negotiation三种