Send request:
When returned, there is a space between the content-type and the HTTP body
HTTP is a no-save state protocol, which means that at the HTTP level, the protocol does not persist for sent requests or for corresponding.
However, for example, if a user logs on to a shopping site, even if he jumps to the other pages of the station, it also needs to be able to keep the login status, for this instance, the site in order to be able to grasp who sent the request, need to save the user's state. HTTP1.1, although a stateless protocol, introduced Cookie technology in order to achieve the desired hold-state functionality.
HTTP method that informs the server of intent
get: Get resources
POST: Transfer entity to server
PUT: Transferring files to the server
Head: Get message header, head method and get method, just do not return the text body content.
Delete: Deleting files, in PUT opposite
Durable connections Save Traffic
An initial version of the HTTP protocol that disconnects a TCP connection every time an HTTP communication is made.
In order to solve the above TCP connection problem, http/1.1 came up with a persistent connection, which is characterized by maintaining the TCP connection status as long as the connection is not explicitly made at either end .
The benefits of a durable connection reduce the server-side load by reducing the additional overhead caused by duplicate builds and disconnects of TCP connections.
In http/1.1, all connections default to persistent connections.
Pipeline
Persistent connections make it possible for most requests to be routed in a pipelined manner. Before sending a request, you wait and receive a response before sending the next request, and the next request can be sent directly without waiting for a response after the pipeline technology appears. This allows multiple requests to be sent in parallel, without waiting for a response one after the other.
State management of using cookies
The problem of maintaining a stateless protocol while also addressing the contradiction of overloading the server (if the server manages all client information) introduces cookie technology, which controls the client state by writing cookie information in the request and response messages.
The cookie notifies the client to save the cookie according to the header field information in the response message sent from the server, and the client automatically adds the cookie value to the requested message when the next client sends a request to the server.
After the server discovers the cookie sent by the client, it checks to see which client is sending the request, then compares the records on the server and finally gets the previous status information.
Bottom number, corresponding
Pay attention to the set-cookie:sid below.
When requested again, it contains the Cookie information
HTTP HTTP1.1 Protocol