You are previewing HTTP: The Definitive Guide.

HTTP: The Definitive Guide

Cover of HTTP: The Definitive Guide by David Gourley... Published by O'Reilly Media, Inc.
O'Reilly logo

Chapter 15. Entities and Encodings

HTTP ships billions of media objects of all kinds every day. Images, text, movies, software programs . . . you name it, HTTP ships it. HTTP also makes sure that its messages can be properly transported, identified, extracted, and processed. In particular, HTTP ensures that its cargo:

  • Can be identified correctly (using Content-Type media formats and Content-Language headers) so browsers and other clients can process the content properly

  • Can be unpacked properly (using Content-Length and Content-Encoding headers)

  • Is fresh (using entity validators and cache-expiration controls)

  • Meets the user's needs (based on content-negotiation Accept headers)

  • Moves quickly and efficiently through the network (using range requests, delta encoding, and other data compression)

  • Arrives complete and untampered with (using transfer encoding headers and Content-MD5 checksums)

To make all this happen, HTTP uses well-labeled entities to carry content.

This chapter discusses entities, their associated entity headers, and how they work to transport web cargo. We'll show how HTTP provides the essentials of content size, type, and encodings. We'll also explain some of the more complicated and powerful features of HTTP entities, including range requests, delta encoding, digests, and chunked encodings.

This chapter covers:

  • The format and behavior of HTTP message entities as HTTP data containers

  • How HTTP describes the size of entity bodies, and what HTTP requires in the way of sizing ...

The best content for your career. Discover unlimited learning on demand for around $1/day.