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

查看:154
本文介绍了“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

推荐答案

每个媒体范围后面可以跟一个或多个accept-params,从q参数开始,用于指示相对品质因数。第一个q参数(如果有的话)将media-range参数与accept-params分开。质量因子允许用户或用户代理使用从0到1的q值标度来指示该媒体范围的相对偏好度。默认值为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天全站免登陆