HTTP protocol and http protocol details
HTTP protocol
Purpose: Describe the protocol for data transmission between the client and the server.
Full name: Hypertext Transfer Protocol
Common versions: 1.0 and 1.1
Stateless Protocol: The first access is irrelevant to the second access.
1.0 is a stateless protocol. Every time you access a service, you need to establish a network connection, which takes time.
1.1 you can send many requests and responses based on a network connection.
For example, <link> <script> automatically sends a request to the server.
HTTP protocol composition: request and response
Composition of the request:
Request Message line-the first line in the request part
Request Message Header-from the second line to the end of the first blank line
Request body-starting from the first blank line
Components:
Response line-located in the first line
Response Header-from the second row to the first empty row
Response body-starting from the first blank line