Basic knowledge of HTTP protocol

xiaoxiao2021-03-06  60

HTTP protocol hyper text Transfer Protocol (HTTP) is a WWW browser (client), and the application layer communication protocol between the servers. HTTP is a quick and utility protocol for distributed collaborative hypermedia information systems, which is a universal, stateless, object-oriented protocol. WWW is based on hyper text. Hypertext is an open reading information, which can be read according to the reader's preferences. HTTP specifies the WWW client / server mode, and any HTTP session in this mode of operation (transaction) includes four steps, as shown below

Just click on a hyperlink, HTTP's work begins. The WWW client establishes a connection with the WWW server via HTTP. After the connection is established, the client issues a request to serve or require information, and some address information and supplementary information are passed to the server. Service processing request, returning the requested information or returns a response indicating that the request cannot be replied, including information, information and services that affect the customer, and some recording status. The client receiving the client receiving the response information returned by the server and displayed on the display via the browser, and the client and server are automatically turned off. If an error occurs in the above process, the error message is generated returning to the client by the display. But for the user, these processes are completed by http, and the user is only clicked with the mouse, and then waits for information to output to the user's display. The HTTP protocol is based on TCP / IP protocol, which not only needs to ensure proper transfer of super text documents, but also be able to determine which part of the document is transmitted, and which part of the content is first displayed. Other WWW services, such as FTP, Telnet, and Gopher must also take advantage of the HTTP. The session between HTTP servers and HTTP clients is as follows: 1 The client establishes link with the server to establish a connection with the socket, so you want to specify the machine name , Resource names and breakage can be provided by URLs. The format of the URL is: http: // / [port number] / [path] [? ] The default value of the resource is index or default, the broken number is 80. 2 Customer to the server The request request information includes the file name and client information you want to return. The client information is sent to the server in request header. The request header includes the HTTP method and the header field. HTTP method is commonly used with GET, Head, POST, and Put, Delete, Link Many HTTP servers are not used by unlink methods. The header field includes:. Date: Request the date and time of the send. PARGMA: For information on the transmission and implementation of the server. This field is also used to tell the agent server, from the actual server instead of cache resources from cache. Forwarded: Can be used to track between machines, not messages, and servers. This field can be used to track the transmission route between the proxy server. . Message_id: Used to uniquely identify the message. Accept: Inform the server customers accept the data type and size. (* / * Means accepting all types of data. .Aothorization: Provides a bypass security protection and encryption mechanism to the server, if the server does not need this field, do not provide this field .FROM: When the client application wants the server to provide the server It uses .IF-modefied-Since when its email address is used to provide conditional GET. If the requested document has not changed since the specified date, the server should not send the object. If the date format is not legal, Or the server is later, the server ignores the field. Beferrer: Use the object to resource request to the server. Mime-VERTION: Used to handle the MIME protocol version number of different types of files.

User-Agent: About the requesting Customer Information 3 Server receives a request for the request to make a reply server, explain the method used in the request, and starts processing a response. The server's response message also contains message information in the form of the header field. . The first line of the message is the state line, the format is the State code is a three-digit digital code, divided into four categories:. At 2 starts, the request is successfully processed. Take 3, indicating that the request is redirected. Start with 4, indicating that the customer's request is wrong. Take 5 out of 5, which means that the server does not satisfy the request to explain the phrase an explanation of the status code. . The packet also returns a few headers to customers, such as:. Status Code / Reason Phrase. Date. Last-modified. Server. Content_type. Retry_AFTER: Returns this field too busy. WWW_AUTHENTICATE: Use this field when the server's security mechanism requires customers to send a certain information.

转载请注明原文地址:https://www.9cbs.com/read-90941.html

New Post(0)