Content-Negotiation Header Quality Values

HTTP: The Definitive Guide

17.3.2 Content-Negotiation Header Quality Values
The HTTP protocol defines quality values to allow clients to list multiple choices for each category of
preference and associate an order of preference with each choice. For example, clients can send an
Accept-Language header of the form:
Accept-Language: en;q=0.5, fr;q=0.0, nl;q=1.0, tr;q=0.0
Where the q values can range from 0.0 to 1.0 (with 0.0 being the lowest preference and 1.0 being the
highest). The header above, then, says that the client prefers to receive a Dutch (nl) version of the
document, but an English (en) version will do. Under no circumstances does the client want a French
(fr) or Turkish (tr) version, though. Note that the order in which the preferences are listed is not
important; only the q values associated with them are.
Occasionally, the server may not have any documents that match any of the client's preferences. In
this case, the server may change or transcode the document to match the client's preferences. This
mechanism is discussed later in this chapter.

原文地址:https://www.cnblogs.com/rsapaper/p/6393059.html