1. Overall operation
The http process is on the request/response way to communicate.
(1) Client sends request to server.
(2) Server responses the request.
(3) There can be proxy, gateway or tunnel on the links between the client and server.
2. HTTP Message
(1) HTTP-message = Request | Response ; HTTP/1.1 messages
(2)message header :
message-header = field-name ":" [ field-value ]
field-name = token
field-value = *( field-content | LWS )
field-content = <the OCTETs making up the field-value
and consisting of either *TEXT or combinations
of token, separators, and quoted-string>
(3) message-body = entity-body
| <entity-body encoded as per Transfer-Encoding>
(4) The transfer-length of a message is the length of the message-body as it appears in the message; that is, after any transfer-codings have been applied.
3. Request
(1) The request packet format:
Request = Request-Line ; *(( general-header;| request-header;| entity-header) CRLF) ;
CRLF
[ message-body ];
(2) Format of Request-line:
Method Request-URI Version CRLF
(3) Method includes: OPTIONS, PUT, POST, GET, DELETE, HEAD, CONNECT etc.
(4) Difference between POST and PUT
PUT is to send data to a specified URI or in another word, to a specified object.
(5) POST is just to tell that I will send the data, it can be processed as you will.
(6) Request-URI = "*" | absoluteURI | abs_path | authority
(7) The request-header fields allow the client to pass additional information about the request, and about the client itself, to the server. These fields act as request modifiers, with semantics equivalent to the parameters on a programming language method invocation.
本文详细介绍了HTTP协议中客户端与服务器之间的请求响应过程,包括请求报文格式、HTTP消息结构及POST与PUT方法的区别等内容。
765

被折叠的 条评论
为什么被折叠?



