5 exercises on HTTP content negotiation vocabulary.
0 / 5 completed
1 / 5
What is HTTP content negotiation?
Content negotiation: the process where the server selects an appropriate representation (format, language, encoding) based on request headers the client sends, so the same URL can serve different variants.
2 / 5
Which request header drives format selection (e.g., JSON vs XML)?
Accept: the client lists acceptable media types (e.g., Accept: application/json) with optional quality weights. The server picks the best match. Content-Type describes the body actually sent, not what is desired.
3 / 5
Which header lets a client request a preferred language?
Accept-Language: the client expresses preferred languages (e.g., Accept-Language: fr, en;q=0.8). The server responds with the chosen language and indicates it via Content-Language.
4 / 5
Why should servers send a Vary response header during content negotiation?
Vary: e.g., Vary: Accept-Encoding tells caches the response differs based on that header, preventing a cache from serving a gzipped body to a client that cannot decompress it.
5 / 5
What does the q-value (quality value) in an Accept header express?
q-value: a weight (e.g., q=0.8) ranking the client's preferences. Higher means more preferred; q=0 means not acceptable. The server uses these to pick the best representation.