首页 > 其他 > 详细

Content-Negotiation Header Quality Values

时间:2017-02-13 12:18:45      阅读:189      评论:0      收藏:0      [点我收藏+]

 

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.

Content-Negotiation Header Quality Values

原文:http://www.cnblogs.com/yuanjiangw/p/6393059.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!