content negotiation

The way a client and server agree on the format, language or compression of a response using request headers such as Accept.

In more detail

The caller sends a wish list, the server picks the best representation it can make and labels it with Content-Type, and it adds Vary so caches know the answer depended on a request header. If nothing on the wish list can be produced, the honest answer is 406. The same mechanism covers language and compression with different header names.

Related terms

Taught in

References