Content negotiation, or conneg as it is sometimes called, is the process of selecting the best representation of a resource for a client when there are multiple representations (or variants) available. Although content negotiation is often associated with the practice of indicating media type preferences, content negotiation is also used to indicate preferences for localizing by language, character encoding, and compression.
HTTP specifies two types of content negotiation. These are server-driven negotiation and agent-driven negotiation. Server-driven negotiation uses request headers to select a variant, and agent-driven negotiation uses a distinct URI for each variant.
This chapter discusses the following recipes that deal with content negotiation:
Use this recipe to decide which
to include when requesting a resource and with what values.
Use this recipe to learn how to implement servers that
correctly interpret the
Accept request header for media
Use this recipe to learn how to implement language negotiation
Use this recipe to learn how to determine the requested character encoding for a representation.
HTTP allows clients to indicate their preference for
compressed representations via the
request header. Use this recipe to decide how to process this header
on the server.
Use this recipe to learn how to use the ...