ch15: Entities and Encodings
Last updated
Last updated
Headers about entities:
Header | Description |
Content-Type | The kind of object carried by the entity. |
Content-Length | The length or size of the message being sent. |
Content-Language | The human language that best matches the obejct being sent. |
Content-Location | An alternate location for the object at the time of the request. |
Content-Range | If this is a partial entity, this header defines which pieces of the whole are included. |
Content-MD5 | A checksum of the contents of the entity body. |
Last-Modified | The date on which this particular content was created or modified at the server. |
Expires | The date and time at which this entity data will become stale. |
Allow | What request methods are legal on this resource. |
ETag | A unique validator for this particular instance of the document. The ETag header is not defined formally as an entity header, but it is an important header for many operations involving entities. |
Cache-Control | Directives on how this document can be cached. The Cache-Control header, like the ETag header, is not defined formally as an entity header. |
Content-Lenght is needed to detect premature message truncation when servers crash and to properly segment messages that share a persistent connection.
The client know where one message ends and the next begins on persistent connections with correct Content-Length.
If the body has been content-encoded, the Content-Length header specifies the length, in bytes, of the encoded body, not the length of the original, unencoded body.
The Content-Type header field describes the MIME type of the entity body, the original entity body, before encoding.
Each component is self-contained, with its own set of headers describing its content, the different components are concatenated together and delimited by a string.
Requests:
Example:
Rather than sending the whole document, the client would get the page faster if the server sent just t he changes to the client's copy of the page.