Please note that the content of this book primarily consists of articles
available from Wikipedia or other free sources online. Content
negotiation is a mechanism defined in the HTTP specification that makes
it possible to serve different versions of a document at the same URI,
so that user agents can specify which version fit their capabilities the
best. One classical use of this mechanism is to serve an image in GIF or
PNG format, so that a browser that cannot display PNG images will be
served the GIF version. To summarize how this works, when a user agent
submits a request to a server, the user agent informs the server what
media types it understands with ratings of how well it understands them.
More precisely, the user agent provides an Accept HTTP header that lists
acceptable media types and associated quality factors. The server is
then able to supply the version of the resource that best fits the user
agent's needs.