In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail which protocol http is mainly used for. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Http is a protocol mainly used to transfer data between browsers and servers. HTTP protocol is the most widely used network transmission protocol on the Internet, all WWW files must comply with this standard; it is based on the TCP/IP communication protocol to transfer data (HTML files, picture files, query results, etc.).
Http (HyperText Transfer Protocol, Hypertext transfer Protocol) is a simple request-response protocol that usually runs on TCP. It specifies what kind of message the client might send to the server and what kind of response it gets. The headers of the request and response messages are given in the form of an ASCII code; the message content has a format similar to MIME. This simple model contributed to the success of early Web because it made development and deployment so straightforward.
At the beginning of its birth, HTTP was mainly used for content acquisition on WEB. At that time, the content was not as rich as it is now, the typesetting was not so exquisite, and there were almost no scenes of user interaction. HTTP is doing pretty well for this simple scenario of getting web content. But with the development of the Internet and the birth of WEB2.0, more content began to be displayed (more picture files), typesetting became more beautiful (more CSS), and more complex interactions were introduced (more jS). The total amount of data and the number of requests that users load on the home page of a website are also increasing.
Today, the home page size of most portals will be more than 2m, and the number of requests can be as many as 100. Another wide range of applications is in the client side of the mobile Internet, APP, different nature of APP to the use of HTTP is very different. For e-commerce APP, there may be as many as 10 requests to load the home page. IM,HTTP requests such as Wechat may be limited to downloads of voice and picture files, and the frequency of requests is not high.
working principle
HTTP is based on the client / server model and is connection-oriented. A typical HTTP transaction has the following process:
(1) the client establishes a connection with the server
(2) the client requests to the server
(3) the server accepts the request and returns the corresponding file as a reply according to the request.
(4) the client closes the connection with the server.
The HTTP connection between the client and the server is an one-time connection, which limits each connection to only one request, closes the connection immediately after the server returns the reply to this request, and re-establishes the connection next time. This one-time connection is mainly considered that the WWW server is for tens of thousands of users in Internet, and can only provide a limited number of connections, so the server will not keep a connection waiting, and releasing the connection in time can greatly improve the execution efficiency of the server.
HTTP is a stateless protocol in which the server does not retain any state when it deals with the customer. This greatly reduces the memory burden of the server, thus maintaining a fast response speed. HTTP is an object-oriented protocol. Allows the transfer of any type of data object. It identifies the content and size of the transmitted data by data type and length, and allows compressed transmission of the data. When the user defines a hypertext chain in an HTML document, the browser establishes a connection to the specified server through the TCP/IP protocol.
Technically, the customer opens a socket on a specific TCP port (the port number is usually 80). If the server has been listening to the connection on this known port, the connection will be established. The customer then sends a request block containing the request method over the connection.
The HTTP specification defines nine request methods, each of which specifies a different way of exchanging information between the client and the server. The commonly used request methods are GET and POST. The server will complete the corresponding operation according to the customer's request, return it to the customer in the form of a reply block, and finally close the connection.
This is the end of the article on which protocol http is mainly used for. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.