“q"的目的是什么?HTTP“接受"中的值请求头? [英] What is the purpose of the "q" values in the HTTP "Accept" request header?

查看:14
本文介绍了“q"的目的是什么?HTTP“接受"中的值请求头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Firefox 发起了一个 http 请求.现在请求标头显示如下:

I have made a http request using Firefox.Now the request header shows the following:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

但很想知道 q=0.9,*/*;q=0.8

推荐答案

每个媒体范围可以后跟一个或多个接受参数,以q"参数开头,用于指示相对质量因子.第一个q"参数(如果有)将媒体范围参数与接受参数分开.质量因素允许用户或用户代理使用从 0 到 1 的 qvalue 标度来指示该媒体范围的相对偏好程度.默认值为 q=1

Each media-range MAY be followed by one or more accept-params, beginning with the "q" parameter for indicating a relative quality factor. The first "q" parameter (if any) separates the media-range parameter(s) from the accept-params. Quality factors allow the user or user agent to indicate the relative degree of preference for that media-range, using the qvalue scale from 0 to 1. The default value is q=1

信息可在这里获得

这里也可以找到很好的解释.

A nice explanation can be found here as well.

这篇关于“q"的目的是什么?HTTP“接受"中的值请求头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆