HTTP Response Header and Request Header Information Comparison Table
HTTP request and response headers are metadata used to transfer information between the client and server. The following is a comparison table of HTTP response header and request header information: | Request header information | Response header information | Description | | --- | --- | Host | | Server name or IP address of the request | User Agent | User agent software ID of the requesting user | Reference | URL address of the request page | Accept | | Tell the server the type of data that can be processed | Accept Encoding | Tell the server the supported data compression format | Accept Lang Uage | | Tell the server the supported languages | Connection | Connection | Tell the server whether to close the connection after the request is completed | Cookie | Set Cookie | Cookie information of the client | Authorization | | User authentication information | If Modified Since | | Cache control, Tell the server the time of the last request | Content Type | | Data type of the request body | Content Length | | Data length of the request body | Range | | Breakpoint continuation, request to obtain resources within a specified range | If None Match | ETag | Cache control, tell the server the ETag information of the last request | The above is a comparison table of some common information between HTTP request headers and response headers, Different request and response headers have different roles and meanings. Through this information, servers and clients can communicate more effectively and improve the efficiency of network transmission.
HTTP response header and request header information comparison table
Header | Explanation | Example |
---|---|---|
Accept | Specify the content type that the client can receive | Accept: text/plain, text/html |
Accept-Charset | The character encoding set that the browser can accept. | Accept-Charset: iso-8859-5 |
Accept-Encoding | Specifies the web server response content compression encoding type that the browser can support. | Accept-Encoding: compress, gzip |
Accept-Language | Languages accepted by the browser | Accept-Language: en,zh |
Accept-Ranges | One or more sub-range fields of the web page entity can be requested | Accept-Ranges: bytes |
Authorization | HTTP authorization certificate | Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== |
Cache-Control | Specify the cache mechanism followed by the request and response | Cache-Control: no-cache |
Connection | Indicates whether a persistent connection is required. (HTTP 1.1 defaults to a persistent connection) | Connection: close |
Cookie | When an HTTP request is sent, all cookie values stored under the request domain name will be sent to the web server together. | Cookie: $Version=1; Skin=new; |
Content-Length | Content length of the request | Content-Length: 348 |
Content-Type | MIME information corresponding to the entity of the request | Content-Type: application/x-www-form-urlencoded |
Date | Date and time the request was sent | Date: Tue, 15 Nov 2010 08:12:31 GMT |
Expect | Request specific server behavior | Expect: 100-continue |
From | Email of the user making the request | From: user@email.com |
Host | Specify the domain name and port number of the requested server | Host: www.zcmhi.com |
If-Match | Only the request 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. If it has not been modified, a 304 code is returned. | If-Modified-Since: Sat, 29 Oct 2010 19:43:31 GMT |
If-None-Match | If the content has not changed, a 304 code is returned. The parameter is the Etag previously sent by the server. It is compared with the Etag responded by the server to determine whether it has changed. | If-None-Match: “737060cd8c284d8af7ad3082f209582d” |
If-Range | If the entity has not changed, the server sends the missing part of the client, otherwise it sends the entire entity. The parameter is also Etag | If-Range: “737060cd8c284d8af7ad3082f209582d” |
If-Unmodified-Since | The request succeeds only if the entity has not been modified after the specified time | If-Unmodified-Since: Sat, 29 Oct 2010 19:43:31 GMT |
Max-Forwards | Limit the time for information to be transmitted through proxies and gateways | Max-Forwards: 10 |
Pragma | Used to contain implementation-specific instructions | Pragma: no-cache |
Proxy-Authorization | Authorization certificate for connecting to the proxy | Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== |
Range | Request only part of the entity, specify the range | Range: bytes=500-999 |
Referer | The address of the previous web page, the current request web page follows it, that is, the source | Referer: http://www.zcmhi.com/archives/71.html |
TE | The client is willing to accept the transfer encoding, and notify the server to accept the tail header information | TE: trailers,deflate;q=0.5 |
Upgrade | Specify a certain transport protocol to the server for conversion (if supported) | Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11 |
User-Agent | The content of User-Agent contains the user information of 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 | Warning information about the message entity | Warn: 199 Miscellaneous warning |
HTTP Responses Header Response Header
Header | Explanation | Example |
---|---|---|
Accept-Ranges | Indicates whether the server supports specified range requests and what 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 | A valid request behavior for a network resource, return 405 if not allowed | Allow: GET, HEAD |
Cache-Control | Tell all cache mechanisms whether to cache and what type | 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 for requesting resources | Content-Location: /index.htm |
Content-MD5 | Return the MD5 checksum of the 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 | MIME type of the returned content | Content-Type: text/html; charset=utf-8 |
Date | The time when the original server message was sent | Date: Tue, 15 Nov 2010 08:12:31 GMT |
ETag | The current value of the entity tag of the request variable | ETag: “737060cd8c284d8af7ad3082f209582d” |
Expires | The date and time the response expires | Expires: Thu, 01 Dec 2010 16:00:00 GMT |
Last-Modified | The 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 non-requested URL to complete the request or identify a new resource | Location: http://www.zcmhi.com/archives/94.html |
Pragma | Includes implementation-specific instructions that can be applied to any recipient in the response chain | Pragma: no-cache |
Proxy-Authenticate | It indicates the authentication scheme and parameters that can be applied to the proxy URL | Proxy-Authenticate: Basic |
refresh | Apply to redirect or a new resource is created, redirect after 5 seconds (proposed by Netscape, supported by most browsers) |
Refresh: 5; url=
http://www.zcmhi.com/archives/94.html
|
Retry-After | If the entity 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 chunked transfer encoding | Trailer: Max-Forwards |
Transfer-Encoding | File transfer encoding | Transfer-Encoding:chunked |
Vary | Tell the downstream proxy whether to use the cached response or request from the original server | Vary: * |
Via | Tells the proxy client where the response was sent | Via: 1.0 fred, 1.1 nowhere.com (Apache/1.1) |
Warning | Warning about possible problems with the entity | Warning: 199 Miscellaneous warning |
WWW-Authenticate | Indicates the authorization scheme that the client request entity should use | WWW-Authenticate: Basic |