Introduction to the HTTP protocol
Hypertext Transfer Protocol (Http,hypertext Transfer Protocol) is one of the most widely used network protocols on the Internet.
HTTP is an application-layer protocol for distributed, collaborative, hypermedia information systems.
The HTTP protocol (hypertext Transfer Protocol, Hypertext Transfer Protocol) is a transport protocol used to transmit a hyper-text to a local browser from a WWW server. It can make the browser more efficient and reduce the network transmission. It not only ensures that the computer transmits hypertext documents correctly and quickly, but also determines which part of the document is being transmitted, and which content is displayed first (such as text before graphics), and so on.
HTTP is the application-layer communication protocol between a client browser or another program and a Web server. The hypertext information is stored on the Web server on the Internet, and the client needs to transmit the hypertext information it wants to access over the HTTP protocol. HTTP contains commands and transmission information that can be used not only for Web access, but also for communication between other Internet/intranet application systems, enabling the integration of hypermedia access for a variety of application resources.
HTTP method Resource Request methods:
Get,head,post,put,delete,trace,options,connection
Main operations of Web server
1. Establish a connection--receive or reject a connection request from the client
2. Receiving requests-read HTTP requests over the network
3. Process the request--parse the request message and make the corresponding action
4. Access to resources-access to related resources in Request messages
5. Build response-Generate HTTP response messages with the correct header
6. Send response--Send the generated response message to the client
7. Logging--When the completed HTTP transaction is logged to the log file
HTTP messages are divided into: Request messages and response messages
Syntax for request messages:
<method> <request-Url> <version>
<entity-body>
method--Resource Acquisition method
request-url--the requested resource type
version--The version number of the requested resource
The first of the Headers--http agreement
entity-body--message body
Response Message Syntax:
<version> <status> <reason-phrase>
<entity-body>
HTTP Common Status codes:
1XX: Pure Information
2XX: "Success" type of information, request content successful information class
3XX: Redirect class information
301: Permanent redirect, the requested page has been transferred to the new URL.
301: Temporary redirection, the requested page has been temporarily transferred to the new URL.
304: The client has buffered documents and issued a conditional request, the server tells the customer that the original buffered document can continue to use.
4XX: Client-side Error information class
404 Not Found: The server was unable to find the requested page.
5XX: Service-side error message
Internal Server Error: The request was not completed. The server encountered unpredictable conditions.
This article is from a "self-made" blog, be sure to keep this source http://baishouqijia.blog.51cto.com/2580498/1681724
Basic interpretation of HTTP protocol