Java Basics: HTTP protocol

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.