HTTP Headers - Part 4 of Chapter 3 from HTTP: The Definitive Guide (6/6)
[previous] |
HTTP: The Definitive Guide, Chapter 3: HTTP Messages
Entity Headers
There are many headers to describe the payload of HTTP messages. Because both request and response messages can contain entities, these headers can appear in either type of message.
Entity headers provide a broad range of information about the entity and its content, from information about the type of the object to valid request methods that can be made on the resource. In general, entity headers tell the receiver of the message what it's dealing with. Table 3-21 lists the entity informational headers.
Table 3-21: Entity informational headers
Header | Description |
---|---|
Allow | Lists the request methods that can be performed on this entity |
Location | Tells the client where the entity really is located; used in directing the receiver to a (possibly new) |
Content headers
The content headers provide specific information about the content of the entity, revealing its type, size, and other information useful for processing it. For instance, a web browser can look at the content type returned and know how to display the object. Table 3-22 lists the various content headers.
Table 3-22: Content headers
Header | Description |
---|---|
Content-Base[19] | The base URL for resolving relative URLs within the body |
Content-Encoding | Any encoding that was performed on the body |
Content-Language | The natural language that is best used to understand the body |
Content-Length | The length or size of the body |
Content-Location | Where the resource actually is located |
Content-MD5 | An MD5 checksum of the body |
Content-Range | The range of bytes that this entity represents from the entire resource |
Content-Type | The type of object that this body is |
Entity caching headers
The general caching headers provide directives about how or when to cache. The entity caching headers provide information about the entity being cached--for example, information needed to validate whether a cached copy of the resource is still valid and hints about how better to estimate when a cached resource may no longer be valid.
In Chapter 7, we dive deep into the heart of caching HTTP requests and responses. We will see these headers again there. Table 3-23 lists the entity caching headers.
Table 3-23: Entity caching headers
Header | Description |
---|---|
ETag | The entity tag associated with this entity[20] |
Expires | The date and time at which this entity will no longer be valid and will need to be fetched from the original source |
Last-Modified | The last date and time when this entity changed |
For More Information
For more information, refer to:
- https://www.w3.org/Protocols/rfc2616/rfc2616.txt
- RFC 2616, "Hypertext Transfer Protocol," by R. Fielding, J. Gettys, J. Mogul, H. Frystyk, L. Mastinter, P. Leach, and T. Berners-Lee.
- HTTP Pocket Reference
- Clinton Wong, O'Reilly & Associates, Inc.
- https://www.w3.org/Protocols/
- The W3C architecture page for HTTP.
19. The Content-Base header is not defined in RFC 2616. Back
20. Entity tags are basically identifiers for a particular version of a resource. Back
[previous] |
Created: February 5, 2003
Revised: February 5, 2003
URL: https://webreference.com/programming/http/chap3/4/6.html