Current location - Quotes Website - Collection of slogans - Detailed description of http protocol
Detailed description of http protocol
The early version of HTTP is HTTP/0.9, which is suitable for simple and fast protocols of various data and information, but it is far from meeting the needs of developing various applications. However, as an HTTP protocol, HTTP/0.9 is typically stateless: each transaction is handled independently, and a connection is established between the client and the server at the beginning of the transaction and released at the end of the transaction. HTTP/0.9 contains

Simple request. Simple response message structure. But the client can't use content negotiation, so the server can't return the media type of the entity.

1982, Tim Berners Lee proposed HTTP/ 1.0, and then HTTP/ 1.0 became the most important transaction-oriented application layer protocol. This protocol establishes and disconnects connections for each request/response. It is simple and easy to manage, so it meets everyone's needs and has been widely used. Its disadvantage is that there will still be the following problems: slow response to user requests, serious network congestion, security and so on.

HTTP/ 1. 1, formed in 1997, is a commonly used protocol at present. In the continuous connection operation mechanism, the pipeline mode is realized, that is, when the client needs to send multiple requests to the same server, most web pages are actually composed of multiple parts (such as multiple pictures), which can be accelerated through the pipeline mode. Pipeline mechanism refers to sending multiple requests continuously and waiting for these requests to be sent. This greatly saves the time of waiting for the response of a single request and enables us to browse faster.

In addition, the HTTP/ 1. 1 server processes the requests in the received order, which ensures the correctness of transmission. Of course, when the connection is interrupted, the server will automatically retransmit the request to ensure the integrity of the data.

HTTP/ 1. 1 also provides authentication, state management, caching and other mechanisms. Here, I would like to mention in particular the improvement of the caching mechanism in HTTP/ 1. 1 .0. It is strict and comprehensive, which can not only reduce time delay, but also save bandwidth. HTTP/ 1. 1 adopts the content negotiation mechanism to select the most suitable content expression form for users.

The virtual host technology used in many places now can also be implemented in HTTP/ 1. 1. The so-called virtual host technology means that the same host address actually corresponds to multiple hosts. Generally speaking, when you apply for two homepages of a website at the same time, the protocol analyzer can find that the two homepages actually correspond to the same IP address. In this way, using multiple identical machines to form a WWW server can improve the processing throughput.

The traditional solution is to transform the domain name server so that it can interpret the same domain name into different IP addresses according to a certain algorithm. The disadvantage of each machine corresponding to a virtual host is that each machine needs to occupy a completely independent IP address, which is contradictory to the lack of IP addresses.

The solution provided by HTTP/ 1. 1 is to add the function of specifying different hosts in the HTTP protocol itself, so that multiple hosts can * * * share an IP address, which not only improves performance but also facilitates management.

Since HTTP/ 1. 1 is the standard protocol of the Internet at present, this paper introduces its related syntax in detail.

First, the format of HTTP/ 1. 1 can be written as follows:

[img:8d94cc43ef] 80

HEAD / HTTP/ 1. 1

Moderator: www.fudan.edu.cn/* Enter the content of this behavior */

The method of http/1.1501is not implemented.

Date: Web, 0 1 20001Month 07: 12: 29 GMT/* Current date/time */

Server: Apache/1.3.12 (UNIX)/* web server information */

Allow: supported method types are get, head, option, trace/* *

Connecting: closing

Connection type: text/html; Charset=iso-8859- 1/* Media type of connection */

& lt! DOCTYPE HTML PUBLIG "-//IETF//DTD HTML 2.0//EN " & gt;

& ltHTML & gt& ltHEAD & gt

< title & gt501method

Not implemented ;

& lt/HEAD & gt; & ltBODY & gt

& lth 1 & gt; Method not implemented & lt/h1>

Go to/India

Don't support x.html. & ltP & gt

Request head/HTP/1.1<; P & gt

& ltHR & gt

& lt address & gt

Apache/ 1.3. 12 server of www.fudan.edu.cn port 80 ;

& lt/BODY & gt; & lt/HTML & gt;

The content about the entity title can also include:

Last Modified Time: the latest modified time of the requested document.

Expires: the expiration time of the requested document.

Connect-length: the length of the document data.

WWW-authenricate: notify the client of the required authentication information.

Connect-encoding: indicates whether compression technology is used.

Transfer-encoding: describes the type of encoding conversion used.

With the development of Internet, the next generation HTTP-ng protocol is in the pipeline, which will provide better security and faster speed. Its improvement points are: strong modularity, high network efficiency, better security and simpler structure.