HTTP header details

Source: Internet
Author: User
Tags http cookie ranges

HTTP (hypertexttransferprotocol) is the hypertext transfer protocol, which is currently a common protocol for webpage transmission. The HTTP protocol uses a request/response model. A browser or other client sends a request, and the server gives the response. The entire network resource transmission involves message-header and message-body. First pass the message-header, that isHTTP HeaderMessage.HTTP header messages are generally divided into four parts: General header, request header, response header, and entity header. However, in terms of understanding this method, I feel that the boundary is not clear. According to the content organization of HTTP headers in Wikipedia, the content is divided into two parts: request and response.

Requests
Header Explanation Example
Accept Specifies the content type that the client can receive Accept: text/plain, text/html
Accept-charset String set that the browser can accept. Accept-charset: iso-8859-5
Accept-Encoding Specifies the type of content compression encoding that can be returned by the Web server supported by the browser. Accept-encoding: compress, Gzip
Accept-Language Acceptable browser Language Accept-language: En, ZH
Accept-ranges You can request one or more sub-range fields of a webpage object. Accept-ranges: bytes
Authorization HTTP Authorization Certificate Authorization: Basic qwxhzgrpbjpvcgvuihnlc2ftzq =
Cache-control Specify the cache mechanism for requests and responses Cache-control: No-Cache
Connection Indicates whether a persistent connection is required. (HTTP 1.1 performs persistent connections by default) Connection: Close
Cookie When an HTTP request is sent, all cookie values stored under the domain name of the request are sent to the web server. COOKIE: $ version = 1; Skin = new;
Content-Length Request Content Length Content-Length: 348
Content-Type Mime information of the request corresponding to the object Content-Type: Application/X-WWW-form-urlencoded
Date Date and time when the request was sent Date: Tue, 15 Nov 2010 08:12:31 GMT
Secondary CT Specific server behavior of the request Secondary CT: 100-continue
From Email of the user sending the request From: [email protected]
Host Specify the domain name and port number of the requested Server HOST: www.zcmhi.com
If-match Valid only when the request content matches the object If-Match: "737060cd8c284d8af7ad3082f209582d"
If-modified-since If the request is modified after the specified time, the request is successful. If the request is not modified, code 304 is returned. If-modified-since: sat, 29 Oct 2010 19:43:31 GMT
If-None-match If the content is not changed, the system returns the 304 code. The parameter is the etag previously sent by the server. Compare it with the etag responded by the server to determine whether the etag is changed. If-None-Match: "737060cd8c284d8af7ad3082f209582d"
If-Range If the entity has not changed, the server sends the part lost by the client; otherwise, the whole entity is sent. The parameter is also etag. If-range: "737060cd8c284d8af7ad3082f209582d"
If-unmodified-since The request is successful only when the object is not modified after the specified time. If-unmodified-since: sat, 29 Oct 2010 19:43:31 GMT
Max-forwards Restrict the time when information is transmitted through the proxy and gateway Max-forwards: 10
Pragma Used to include specific instructions Pragma: No-Cache
Proxy-Authorization Connect to the proxy authorization certificate Proxy-authorization: Basic qwxhzgrpbjpvcgvuihnlc2ftzq =
Range Request only part of the object, specifying the range Range: bytes = 500-999
Referer The address of the previous webpage, followed by the current requested webpage. Referer: http://www.zcmhi.com/archives/71.html
Te The client is willing to accept the transfer code and notifies the server to accept the tail header information. Te: trailers, deflate; q = 0.5
Upgrade Specify a certain transmission protocol to the server for server conversion (if supported) Upgrade: HTTP/2.0, shttp/1.3, IRC/6.9, RTA/X11
User-Agent The User-Agent content contains the user information that sends the request. User-Agent: Mozilla/5.0 (Linux; X11)
Via Notify the intermediate gateway or proxy server address, communication protocol Via: 1.0 Fred, 1.1 nowhere.com (Apache/1.1)
Warning Message entity warning information Warn: 199 miscellaneous warning
Responses Section
Header Explanation Example
Accept-ranges Indicates whether the server supports specified range requests and the type of segmented requests Accept-ranges: bytes
Age Estimated time from the origin server to the proxy cache (in seconds, non-negative) Age: 12
Allow Valid request behavior for a network resource. If the request is not allowed, 405 is returned. Allow: Get, head
Cache-control Tell all cache mechanisms whether they can be cached or not Cache-control: No-Cache
Content-Encoding The compression encoding type of the returned content supported by the Web server. Content-encoding: Gzip
Content-language Response Body Language Content-language: En, ZH
Content-Length Response body length Content-Length: 348
Content-location Another alternative address that the requested resource can replace Content-location:/index.htm
Content-MD5 Returns the MD5 checksum of the resource. Content-MD5: q2hly2sgsw50zwdyaxr5iq =
Content-Range Bytes in the whole returned body Content-range: bytes 21010-47021/47022
Content-Type Mime Type of returned content Content-Type: text/html; charset = UTF-8
Date Time when the original server message was sent Date: Tue, 15 Nov 2010 08:12:31 GMT
Etag Current Value of the object tag of the Request variable Etag: "737060cd8c284d8af7ad3082f209582d"
Expires Response expiration date and time Expires: Thu, 01 Dec 2010 16:00:00 GMT
Last-modified Last modification time of the requested resource Last-modified: Tue, 15 Nov 2010 12:45:26 GMT
Location Used to redirect the recipient to a location other than the requested URL to complete the request or identify a new resource Location: http://www.zcmhi.com/archives/94.html
Pragma Includes the implementation of specific commands that can be applied to any receiver on the response chain. Pragma: No-Cache
Proxy-Authenticate It specifies the authentication scheme and the parameters that can be applied to the URL of the proxy. Proxy-Authenticate: Basic
Refresh Apply to redirection or a new resource is created and redirected in 5 seconds (proposed by Netscape and supported by most browsers)  

 

Refresh: 5, url = http://www.zcmhi.com/archives/94.html
Retry-after If the object is temporarily unavailable, notify the client to try again after the specified time Retry-after: 120
Server Web server software name Server: Apache/1.3.27 (UNIX) (red-hat/Linux)
Set-Cookie Set HTTP cookie Set-COOKIE: userid = johndoe; max-age = 3600; version = 1
Trailer Indicates that the header field exists at the end of the multipart Transfer Encoding. Trailer: Max-forwards
Transfer-Encoding File Transfer Encoding Transfer-encoding: chunked
Vary Tell the downstream proxy whether to use cache response or request from the original server Vary :*
Via Tell the proxy client where the response is sent Via: 1.0 Fred, 1.1 nowhere.com (Apache/1.1)
Warning Warning possible entity Problems Warning: 199 miscellaneous warning
WWW-Authenticate Indicates the authorization scheme that the client request entity should use WWW-Authenticate: Basic

For more information, see header field definitions on the W3C website.

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.