One: Two versions of the HTTP protocol
There are two versions of the HTTP protocol: HTTP1.0 and HTTP1.1
The main difference is that, in the HTTP1.0 protocol, after a client has established a connection with a Web server, only one Web resource can be obtained. And HTTP1.1 can get multiple resources.
HTTP 1.0 Specifies that the browser and the server only maintain a brief connection, each request of the browser needs to establish a TCP connection with the server, the server completes the request processing immediately after disconnecting the TCP connection, the server does not track each customer also does not log past requests.
to overcome this flaw in HTTP 1.0, HTTP 1.1 supports persistent connections, which can transmit multiple HTTP requests and responses on a single TCP connection, reducing the consumption and latency of establishing and shutting down connections. Multiple requests and responses for a Web page file that contains many images can be transferred in one connection, but requests and responses for each individual Web file still need to use their own connection.
Two: telnet example description
Using Telnet to access Web server resources, if the HTTP1.0 request is used once, the connection is broken immediately. "Missing connection to host" is prompted
If the connection still exists after using the HTTP1.1 request once, you can continue to access the Web resource!
Java Basics: HTTP protocol