The TCP/IP Guide - Version 3.0 (Contents) ` 1578 _ © 2001-2005 Charles M. Kozierok. All Rights Reserved.
HTTP Entities, Transfers, Coding Methods and Content Management
HTTP message headers are very important, because they are the mechanism that HTTP
uses to allow devices to specify the details of client requests and server responses. These
headers, however, are only the means to an end, which is the transfer of resources such as
files, form input and program output from one device to another. When a resource is carried
in the body of an HTTP message, it is called an entity. HTTP defines special rules for how
these entities are identified, encoded and transferred.
In this section, I take a detailed look at how HTTP handles entities. I begin with a discussion
of entities in general terms, and a look at how their contents are identified; this includes an
examination of the relationship between HTTP and MIME. I discuss the issues behind the
transfer of entities between clients and servers, and the difference between content
encodings and transfer encodings. I describe the special issues associated with identifying
the length of entities in HTTP messages, and detail the special “chunked” transfer coding
and message trailers. Finally, I describe the methods by which devices can perform content
negotiation, and how quality values allow clients to intelligently select different variations of
a resource.
HTTP Entities and Internet Media Types
The presence of the word “text” in the name “Hypertext Transfer Protocol” is a reminder of
the legacy of HTTP. As I explained in my brief history of the World Wide Web, it was origi-
nally created to allow text documents to be linked together. This made sense, because at
the time that the Web was being created, most computing was still being done with text.
Accordingly, the first version of HTTP (HTTP/0.9) supported only one type of message
body: a plain ASCII text document.
In the early 1990s, the rapid increase in computing power and networking performance
transformed the world of information technology from text to multimedia. These were also
the World Wide Web’s formative years, and it did not take long before many users wanted
to exploit the power of the Web to share not only text files but also pictures, drawings,
sound clips, movies and much more. Thus, HTTP had to evolve as well; starting with HTTP/
1.0, significant changes were made to allow the protocol to transport and process much
more than just text. Today, HTTP really would be better described as dealing with hyper-
media than hypertext, though the name of the protocol was never changed.
One drawback of supporting many types of files in HTTP is added complexity. Where before
every message recipient knew the body contained ASCII text, now any message can
contain any of many kinds of data. When HTTP was expanded to support flexible media, it
needed a system that would address two specific issues: encoding entities of various types
into an HTTP message body, and clearly identifying the entity’s characteristics for the
recipient of the message.
At the same time that HTTP was being changed to support non-text entities, another
important TCP/IP application was also moving away from its decades-long role as a text-
messaging medium, to one that could transport multimedia: electronic mail. This was
accomplished using a technology called Multimedia Internet Mail Extensions (MIME), which