HTTP request headers provide information about the request, response, or other sending entities. HTTP header information includes general headers, request headers, response headers, and entity headers. Each header field consists of a domain name, a colon (:), and a field value.
Header | Explanation | Example |
---|---|---|
Accept | Specifies the content types that the client is willing to accept. | Accept: text/plain, text/html |
Accept-Charset | Browsers that can accept the character set encoding. | Accept-Charset: iso-8859-5 |
Accept-Encoding | Specifies the web server response content compression encoding types that the browser can support. | Accept-Encoding: compress, gzip |
Accept-Language | The language that the browser can accept. | Accept-Language: en,zh |
Accept-Ranges | Can request one or more sub-ranges of the web page entity. | Accept-Ranges: bytes |
Authorization | HTTP authorization credentials. | Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== |
Cache-Control | Specifies the caching mechanism to be followed by the request and response. | Cache-Control: no-cache |
Connection | Indicates whether a persistent connection is required. (HTTP 1.1 defaults to persistent connection) | Connection: close |
Cookie | When an HTTP request is sent, all the cookie values saved under the domain name of the request are sent to the web server. | Cookie: $Version=1; Skin=new; |
Content-Length | The length of the content in the request. | Content-Length: 348 |
Content-Type | The MIME information corresponding to the entity in the request. | Content-Type: application/x-www-form-urlencoded |
Date | The date and time when the request is sent. | Date: Tue, 15 Nov 201 8:12:31 GMT |
Expect | Requests a specific server behavior. | Expect: 100-continue |
From | The email of the user who sent the request. | From: user@email.com |
Host | Specifies the domain name and port number of the server for the request. | Host: www.zcmhi.com |
If-Match | Only valid if the requested content matches the entity. | If-Match: "737060cd8c284d8af7ad3082f209582d" |
If-Modified-Since | If the requested part has been modified after the specified time, the request is successful, otherwise it returns a 304 code. | If-Modified-Since: Sat, 29 Oct 201 19:43:31 GMT |
If-None-Match | If the content has not changed, return a 304 code. The parameter is the Etag previously sent by the server, which is compared with the Etag in the server's response to determine if it has changed. | If-None-Match: "737060cd8c284d8af7ad3082f209582d" |
If-Range | If the entity has not changed, the server sends the part that the client has lost, otherwise it sends the entire entity. The parameter is also Etag. | If-Range: "737060cd8c284d8af7ad3082f209582d" |
If-Unmodified-Since | Only request successful if the entity has not been modified after the specified time | If-Unmodified-Since: Sat, 29 Oct 201 19:43:31 GMT |
Max-Forwards | Limit the time the information is forwarded through proxies | Max-Forwards: 10 |
Pragma | Used to include implementation-specific directives | Pragma: no-cache |
Proxy-Authorization | Authorization credentials for connecting to a proxy | Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== |
Range | Request only a part of the entity, specifying the range | Range: bytes=500-999 |
Referer | The address of the previous web page, the current requested web page follows immediately, i.e., the source | Referer: http://www.zcmhi.com/archives/71.html |
TE | The transfer coding the client is willing to accept, and to notify the server to accept trailing header information | TE: trailers,deflate;q=.5 |
Upgrade | Specify a transfer protocol to the server for it to switch to (if supported) | Upgrade: HTTP/2., SHTTP/1.3, IRC/6.9, RTA/x11 |
User-Agent | The content of User-Agent includes information about the user making the request | User-Agent: Mozilla/5. (Linux; X11) |
Via | Notify intermediate proxies or server addresses, communication protocol | Via: 1. fred, 1.1 nowhere.com (Apache/1.1) |
Warning | Warning information about the message entity | Warn: 199 Miscellaneous warning |
Header | Explanation | Example |
---|---|---|
Accept-Ranges | Indicates whether the server supports the specified range requests and what type of range requests | Accept-Ranges: bytes |
Age | The estimated time (in seconds, non-negative) from the original server to the proxy cache | Age: 12 |
Allow | The valid request actions for a network resource, if not allowed, return 405 | Allow: GET, HEAD |
Cache-Control | Tell all caching mechanisms whether they can cache and what type | Cache-Control: no-cache |
Content-Encoding | The types of content compression encoding supported by the web server | Content-Encoding: gzip |
Content-Language | The language of the response body | Content-Language: en,zh |
Content-Length | The length of the response body | Content-Length: 348 |
Content-Location | An alternative address for the requested resource | Content-Location: /index.htm |
Content-MD5 | The MD5 checksum of the returned resource | Content-MD5: Q2hlY2sgSW50ZWdyaXR5IQ== |
Content-Range | The byte position of this part in the entire response body | Content-Range: bytes 21010-47021/47022 |
Content-Type | The MIME type of the returned content | Content-Type: text/html; charset=utf-8 |
Date | The time the original server message was sent | Date: Tue, 15 Nov 201 8:12:31 GMT |
ETag | The current value of the entity tag for the requested variable | ETag: “737060cd8c284d8af7ad3082f209582d” |
Expires | The expiration date and time of the response | Expires: Thu, 1 Dec 201 16:00:00 GMT |
Last-Modified | The last modified time of the requested resource | Last-Modified: Tue, 15 Nov 201 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 implementation-specific directives that apply to any recipient along the request-response chain | Pragma: no-cache |
Proxy-Authenticate | It indicates the authentication scheme and parameters applicable to the proxy for the URL | Proxy-Authenticate: Basic |
refresh | Applied to redirection or the creation of a new resource, redirect after 5 seconds (proposed by Netscape, supported by most browsers) |
Refresh: 5; url=
http://www.zcmhi.com/archives/94.html |
Retry-After | Informs the client to retry after a specified time if the entity is temporarily unavailable | 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 fields are present in the trailer of chunked transfer encoding | Trailer: Max-Forwards |
Transfer-Encoding | File transfer encoding | Transfer-Encoding: chunked |
Vary | Informs downstream proxies whether to use a cached response or request from the original server | Vary: * |
Via | Informs the client that the response was sent through which proxy | Via: 1. fred, 1.1 nowhere.com (Apache/1.1) |
Warning | Warns of potential issues with the entity | Warning: 199 Miscellaneous warning |
WWW-Authenticate | Indicates the authorization scheme that the client should use to request the entity | WWW-Authenticate: Basic |