一直使用HTTP,却从未看来过他的协议自己。前端
此次把这个技术债补上。浏览器
HTTP 1.1RFC编号2616,地址: 缓存
https://www.ietf.org/rfc/rfc2616.txt服务器
由于HTTP/1.0没有充分考虑到分层代理,缓存的做用以及对稳定链接和虚拟主机的需求。cookie
全部才有了HTTP/1.1的诞生。app
(相关 cookies 地址https://www.ietf.org/rfc/rfc6265.txt )ide
此次阅读记录如下几点:ui
1.默认编码是 ISO-8859-1this
3.7.1 Canonicalization and Text Defaults编码
The "charset" parameter is used with some media types to define the
character set (section 3.4) of the data. When no explicit charset
parameter is provided by the sender, media subtypes of the "text"
type are defined to have a default charset value of "ISO-8859-1" when
received via HTTP. Data in character sets other than "ISO-8859-1" or
its subsets MUST be labeled with an appropriate charset value. See
section 3.4.1 for compatibility problems.
2.HTTP并不是必定是创建在TCP/IP协议上。任何能保证可靠传输的均可以。
HTTP communication usually takes place over TCP/IP connections. The default port is TCP 80 [19], but other ports can be used. This does not preclude HTTP from being implemented on top of any other protocol on the Internet, or on other networks. HTTP only presumes a reliable transport; any protocol that provides such guarantees can be used; the mapping of the HTTP/1.1 request and response structures onto the transport data units of the protocol in question is outside the scope of this specification.
3.HTTP协议自己要求对URI不作长度限制。
The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).
4.只有第2个request事GET或者Head 时,重定向才能够不经过用户。
This class of status code indicates that further action needs to be
taken by the user agent in order to fulfill the request. The action
required MAY be carried out by the user agent without interaction
with the user if and only if the method used in the second request is
GET or HEAD.
5.缓存
缓存是HTTP协议的重要部分,占了协议至关的笔墨
工做里常常遇到改了前端页面,按F5刷新没有效果,须要使用浏览器的清除缓存功能。缘由就是浏览器实现了HTTP协议的缓存。
经过2个字段 Expires、Cache-control实现
6.URL太长
10.4.15 414 请求URI太长(Request-URI Too Long)
服务器拒绝为请求服务由于此请求URI太长了以致于服务器不能理解。这种状况是不多的,只发生在当客户端把POST请求不合适地转换为带有大量查询信息的GET请求时。