When we browse the Internet, most of them will see the HTTP text when we type an address in the address bar. However, do you know what HTTP is? HTTP is a protocol called Hypertext Transfer protocol. Now, let's explain the basic concepts of HTTP. I hope everyone can understand the Core Protocol of WWW.
Hypertext Transfer Protocol (HTTP) is a distributed, cooperative, Multimedia Information System Service, application-layer-oriented protocol. It is a common, stateless protocol. In addition to hypertext purposes such as name services and distributed object management systems, it can also expand its request methods, error code and header to complete many tasks. One feature of HTTP is that the data representation is typical and can be used collaboratively to establish a system independent of data transmission.
In 1990, when WWW global information was just getting started, HTTP was applied. The first version of HTTP is called HTTP/0.9, which is a simple protocol for the original Internet Data Transmission Service. HTTP/1945 defined by RFC 1.0 further improves this protocol. It allows message transmission in MIME-like format, including maintenance information about data transmission and syntactic correction about requests/responses. However, HTTP/1.0 does not fully consider the role of layered proxy, high-speed cache, and the demand for stable connections and virtual hosts. With the proliferation of imperfect process applications, HTTP/1.0 urgently needs a new version so that two communication applications can determine the real performance of each other.
The Protocol specified here is called "HTTP/1.1". This protocol is stricter than HTTP/1.0 to ensure reliable implementation of various functions.
In addition to simple retrieval, the actual information system requires more functional functionality, including search, front-end update, and annotation ). HTTP allows Extensible Method sets and header sets to indicate the purpose of the request [47]. It is created on [20] of the Uniform Resource Identifier URI) [3] provided URL) [4] and name URN to indicate the resource to which the method is applied. Messages are transmitted in a format similar to Internet Mail called multi-purpose network Mail Extension MIME) [7.
HTTP is also a common communication protocol used between user proxies and between proxy/gateway and other network systems. Such network systems may be supported by SMTP, NNTP, FTP, Gopher, and WAIS protocols. In this way, HTTP allows different applications to perform basic hypermedia access to resources.
Basic concept of HTTP protocol-overall operation
HTTP is a request/response protocol. After establishing a connection with the host, the customer sends a request to the server in the form of request method, URI, and Protocol version, following the MIME-like information, including request modification, customer information and possible body content.
The server responds with the status that includes the Message Protocol version and successful or error code, followed by MIME-like messages that include server information, entity maintenance information, and possible entity content.
Most HTTP Communication is triggered by a user proxy and consists of requests that are applied to resources on some original servers. In the simplest case, you can use a single connection v between the user agent UA and the original server O.
Request chain ----> User Agent (UA) ----- single connection v) ---- original server O) <---- response chain
When one or more intermediaries appear in the request/response chain, more complex situations may occur. There are three common mediation forms: proxy, gateway, and tunnel. A proxy is a transfer tool that receives an absolute URI request, overrides all or part of the message, and then sends the re-formatted request to the server specified by the URI. A gateway is a receiving tool that acts as the upper layer of other servers and translates requests into lower-layer Server protocols if necessary. A tunnel acts as a relay between two connections without changing the message. It is used for communication that needs to pass through an intermediary such as a firewall), or even when the intermediary cannot understand the information content.
Request chain ----> UA ----- v ----- A ----- v ----- B ----- v ----- C ----- v ----- O <---- response chain
Shows three intermediaries A, B, and C between the user proxy and the original server ). Requests or response messages that travel the entire chain need to be connected through four independent connections. This feature is very important because some HTTP Communication options can only be applied to the nearest non-tunnel neighbor, link end point, or all connections along the chain. Although the chart is linear, each part may be busy communicating multiple channels at the same time. For example, B can receive requests from many clients different from A and/or forward requests to servers different from C. At the same time, B is still processing requests from.
Any non-tunnel communication member can use the internal cache to process requests. The high-speed cache function is to greatly shorten the request/response chain if a member along the chain uses a high-speed buffer response to the request. The chain produced by the solution. Assume that B has A backup from O through C) from the previous response, and the request has not been cached by UA or.
Request chain ----> UA ----- v ----- A ----- v ----- B-----C----O <---- response chain
Not all responses can be effectively cached. Some requests may contain modifications and have special requirements on Cache actions.
In fact, there are many structures and configurations of High-speed cache and proxy on the World Wide Web to be tested or used. These systems include the National proxy layer that saves off-ocean bandwidth, broadcast or multi-point communication cache interface, the organization that distributes sub-cache data through the CD-ROM, and so on. The HTTP system is used in the enterprise LAN with broadband connection, and accesses through low-consumption wireless connections and intermittent connections of PDAs. HTTP1.1 aims to support various application configurations and introduce protocol structures to meet the requirements of network applications that require high reliability and can eliminate or at least indicate faults.
HTTP Communication usually occurs over TCP/IP connections. The default port is TCP 80, but other ports can also be used. On the Internet or other networks, this does not prevent HTTP applications from being at the top of other protocols. Http only expects reliable transmission. Any protocol that provides such a guarantee can be used. The image of the HTTP/1.1 request and response structure of the protocol transmission data unit is beyond the scope of this Manual.
In http/1.0, most implementations use new connections for each request/response exchange. In http/1.1, a connection can be used for one or more requests/responses, although the connection may be interrupted for various reasons.
So here we will talk about the basic concepts of the HTTP protocol first, and a series of articles later, I hope you will continue to pay attention to it.