Interpretation of HTTP header information

Source: Internet
Author: User

Front-end developers also need to understand the various network protocols, the following is about the HTTP message header information interpretation.

Typically HTTP messages include client-to-server request messages and server-to-client response messages. The client sends a request to the server that contains the requested method, URL, protocol version, and a message structure similar to MIME (message organization structure) that contains the request modifier, customer information, and content. The server responds with a status line that includes the version of the message protocol, success or error encoding plus the server information, entity meta information, and possible entity content.

The HTTP protocol defines a number of ways to interact with the server, with four basic, get, POST, PUT, DELETE, respectively. A URL address is used to describe a resource on a network, and the Get, POST, PUT, delete in HTTP corresponds to the search, change, increment, and delete 4 operations of this resource, the most common is get and POST. Get is typically used to get/query resource information, and post is typically used to update resource information.

Interpretation of HTTP header information

The header of the HTTP includes the general header, the request header, the response header, and the entity header four parts. Each header field consists of a domain name, a colon (:), and a range of three parts.

The generic header is a header that both the client and server can use to provide some useful common functionality between the client, the server, and other applications, such as the date header.

Request headers are unique to the request message, and they provide some additional information to the server, such as what type of data the client wants to accept, such as the receive header.

The response header facilitates the client to provide information, such as what type of server the client interacts with, such as the server header.

The body head refers to the head that is used to respond to the body part of the entity, for example, the entity header can be used to describe the data type of the entity body part, such as Content-type head.

HTTP Generic Header

The generic header contains the header fields that both the request and response messages support, and the generic header domain contains the cache head Cache-control, pragma, and informational head connection, Date, transfer-encoding, Update, Via.

1, Cache-control

CACHE-CONTROL Specifies the caching mechanism that requests and responses follow. Setting Cache-control in a request message or response message does not modify the caching process in another message processing process. The cache directives for the request include No-cache, No-store, Max-age, Max-stale, Min-fresh, only-if-cached, and the instructions in the response message include public, private, No-cache, No-store, No-transform, Must-revalidate, Proxy-revalidate, Max-age. The instructions in each message have the following meanings:

No-cache: Indicates that a request or response message cannot be cached, and can actually be stored in a local cache, except that it cannot be made available to clients until freshness is verified with the original server.

No-store: The cache should remove all traces of the document from memory as soon as possible, as it may contain sensitive information.

Max-age: The cache cannot return a document with a cache time longer than max-age specified seconds, and if no more than the specified seconds the browser will not send the corresponding request to the server, and the data is returned directly from the cache; Over this period of time it is further determined by the server whether to return new data or still be supplied by the store. If the max-stale instruction is also sent, the usage period may exceed its expiration time.

Min-fresh: At least in the next set of seconds the document remains fresh, accepting that its fresh life is greater than its current age and the sum of the Min-fresh value of the cached object.

Max-stale: Indicates that the client can receive an expired response message, and if the value of the Max-stale message is specified, the client can receive a response message that is expired but within the specified value.

Only-if-cached: The client obtains a copy only if a copy exists in the cache.

Public: Indicates that the response can be cached by any buffer and can respond to any customer with cached content.

Private: Specifies that the entire or partial response message for a single user cannot be shared by the cache and only the cached content is used to respond to the user who previously requested the content.

Interpretation of HTTP header information

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.