Webmaster in a Nutshell

Previous Chapter 19 Next
 

19.4 Entity Headers

Entity headers are used in both client requests and server responses. They supply information about the entity body in an HTTP message.

Allow

Allow: methods

Contains a comma-separated list of methods that are allowed at a specified URI. In a server response it is used with code 405 (Method Not Allowed) to inform the client of valid methods available for the requested information. See Chapter 17, HTTP Overview for more information on HTTP methods.

Content-Base

Content-Base: uri

Specifies the base URI for resolving relative URLs. The base URI must be written as an absolute URI.

Content-Encoding

Content-Encoding: encoding_schemes

Specifies the encoding scheme(s) used for the transferred entity body. Values are gzip (or x-gzip) and compress (or x-compress). If multiple encoding schemes are specified (in a comma-separated list), they must be listed in the order in which they were applied to the source data.

Content-Language

Content-Language: languages

Specifies the language(s) that the transferred entity body is intended for. Languages are represented by their 2-digit code (e.g., en for English, fr for French).

Content-Length

Content-Length: n

This header specifies the length of the data (in bytes) of the transferred entity body. Due to the dynamic nature of some requests, the content length is sometimes unknown and this header is omitted.

Content-Location

Content-Location: uri

Supplies the URI for the entity, in cases where a document has multiple entities with separately accessible locations. The URI can be either an absolute or relative URI.

Content-MD5

Content-MD5: digest

Supplies a MD5 digest of the entity, for checking the integrity of the message upon receipt.

Content-Range

Content-Range: bytes n-m/length

Specifies where the accompanying partial entity body should be inserted, and the total size of the full entity body. For example:

Content-Range: bytes 6143-7166/15339

Content-Transfer-Encoding

Content-Transfer-Encoding: scheme

This header specifies any transformations that are applied to the entity body for transport over a network. Common values are: 7bit, 8bit, binary, base64, and quoted-printable.

Content-Type

Content-Type: type/subtype

This header describes the media type and subtype of an entity body. It uses the same values as the client's Accept header, and the server should return media types that conform with the client's preferred formats.

ETag

ETag: entity_tag

Defines the entity tag for use with the If-Match and If-None-Match request headers.

Expires

Expires: date

This header specifies the time when a document may change or its information becomes invalid. After that time, the document may or may not change or be deleted. The value is a date and time in a valid format as described for the Date header.

Last-Modified

Last-Modified: date

This header specifies when the specified URI was last modified. The value is a date and time in a valid format as described for the Date header.

Location

Location: uri

This header specifies the new location of a document, usually with response codes 201 (Created), 301 (Moved Permanently), or 302 (Moved Temporarily). The URI given must be written as an absolute URI.

URI

URI: <uri>

This header specifies the new location of a document, usually with response codes 201 (Created), 301 (Moved Permanently), or 302 (Moved Temporarily). An optional vary parameter may also be used in this header indicating multiple documents at the URI in the following categories: type, language, version, encoding, charset, and user-agent. Sending these parameters in a server response prompts the client to specify its preferences appropriately in the new request. The URI header is deprecated in HTTP 1.1 in favor of the Location, Content-Location, and Vary headers.


Previous Home Next
Server Response Headers Book Index Media Types and Subtypes