HTTP protocol review Summary

Source: Internet
Author: User
1. Basic Concepts

HTTP protocol, that is, Hypertext Transfer protocol. Defines the format of data exchange between the client and the Web server.

The application layer protocol of TCP/IP protocol.

2. Protocol version

HTTP/1.0 (disconnected)

After the client establishes a connection with the web server, only one web resource can be obtained.

HTTP/1.1 (keep connection)

Allow the client to establish a connection with the web server and obtain multiple web resources in a single connection

3. HTTP request)

A complete HTTP request includes

Use firebug to obtain HTTP request information for access to baidu.com, as shown in

 

GET www.baidu.com 200 OK (request line)

Resource Type received by the Accept client

Language type received by the Accept-Language Client

The compression type that the Accept-Encoding client can receive

Connection maintains the Connection between the client and the server.

Host connection destination Host

User-Agent client browser kernel version

Cookie client temporary server information

4. Common HTTP request methods

GET \ POST

Both requests WEB resources from the server.

GET method. The parameters attached to the URL are limited, and the data capacity cannot exceed 1 K.

POST method, you can send data to the server in the request object content

5. HTTP response (response)

An HTTP response indicates the data that the server sends back to the client.

It includes a status line, several message headers, and entity content.

Obviously, it is easy to understand the content in the response information. Note that,

Cache-Control whether the server allows the client to Cache data. In addition, there are two methods, respectively, for different browser environments.

Expires:-1

Cache-Control: no-cache

Pragma: no-cache

The preceding three methods are used to disable browser caching.

6. HTTP response status code

200 OK successfully received the request

302 the client requests resources, but the server does not have the corresponding resources. The server requires the client to request another server, that is, redirect

307 when the client requests resources, but the server does not have the corresponding resources, the server executes another request to another server, that is, the client requests are forwarded.

304 client request. In this case, the client cache does not need to download new resources from the server. The server requires the client to find the cache and optimize it.

404 resource does not exist

500 a server error occurs.

For more information, see Baidu encyclopedia.

Http://baike.baidu.com/view/1790469.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.