HTTP协议小记

整个HTTP消息的组成为

请求行(请求时)/状态行(响应时)

实体

----------------------------------

HTTP消息分为请求和响应两种

两者只在头域中的第二部分不同

请求的头组成为

通用头,请求头,实体头

响应的头组成为

通用头,响应头,实体头

----------------------------------

实体的长度在头中以Content-Length确定

----------------------------------

通用头类型包括:

general-header = Cache-Control          

|Connection

|Date

|Pragma

|Trailer

|Transfer-Encoding

|Upgrade

|Via

                      | Warning                 

请求头类型包括:

request-header = Accept              

|Accept-Charset

|Accept-Encoding

|Accept-Language

|Authorization

|Expect

|From

|Host

|If-Match

|If-Modified-Since

|If-None-Match

|If-Range

|If-Unmodified-Since

|Max-Forwards

|Proxy-Authorization

|Range

|Referer

|TE

                      | User-Agent             

响应头类型包括:

response-header = Accept-Ranges         

|Age

|ETag

|Location

|Proxy-Authenticate

|Retry-After

|Server

|Vary

                       | WWW-Authenticate      

实体头类型包括:

entity-header  = Allow                   

|Content-Encoding

|Content-Language

|Content-Length

|Content-Location

|Content-MD5

|Content-Range

|Content-Type

|Expires

|Last-Modified

                      | extension-header

其中

extension-header = message-header

相关推荐