Content negotiation
Content negotiation is an HTTP technique to identify the "best available" response for a client request when multiple responses may be available on the server.
Note
The RFC 2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html) specification for HTTP allows server-driven, agent-driven, and transparent negotiations. For the scope of this chapter, we focus on server-driven negotiations.
The negotiation between the client and the server is accomplished through a set of HTTP headers. These header fields are used by the client to express the desired content type or media type, this information is then used by the server to format the response in a way the client can understand:
Field |
Description |
---|---|
|
These specify certain attributes that are acceptable for a response. These headers specify to the server the type of response expected. For example, |