- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我一直在阅读HTTP/1.1 headers,并在14.1节(接受)的一些示例 header 中使用了accept-extension
,level=1
等(我相信是这样)。
我遇到的问题是他们使用这些level=2
东西,好像他们在做什么很明显。该文档是否仅能说明问题?还是我遗漏了一些东西?
谢谢。
最佳答案
...几年后
用户TomWardrop指出了这一点(从评论到此答案):
It use to be part of the text/html media type specification to indicate what version of HTML you wanted, but is wasn't used much (if at all), so it was dropped. Refer to ietf.org/rfc/rfc2854.txt.
Note that [HTML20] included an optional "level" parameter; in practice, this parameter was never used and has been removed from this specification. [HTML30] also suggested a "version" parameter; in practice, this parameter also was never used and has been removed from this specification.
level
扩展名。似乎也没有任何人在 header 中使用它,这表明它可能可以忽略。
level
参数,但从未提及或明确表达了它所起的作用。
level
:
Media ranges can be overridden by more specific media ranges or specific media types. If more than one media range applies to a given type, the most specific reference has precedence. For example,
Accept: text/*, text/html, text/html;level=1, */*
have the following precedence:
1) text/html;level=1
2) text/html
3) text/*
4) */*
text/html;level=1
的优先级比
text/html
的优先级高,这意味着
level
扩展名必须为其赋予该优先级。根据降低的特异性,最后两个显然有进一步的顺序。
q
。在RFC中对此进行了很好的解释。可以是
between 0
and 1
。值越大,类型的优先级越高。 RFC有一个同时使用
q
和
level
的示例:
The media type quality factor associated with a given type is determined by finding the media range with the highest precedence which matches that type. For example,
Accept: text/*;q=0.3, text/html;q=0.7, text/html;level=1,
text/html;level=2;q=0.4, */*;q=0.5would cause the following values to be associated:
text/html;level=1 = 1
text/html = 0.7
text/plain = 0.3
image/jpeg = 0.5
text/html;level=2 = 0.4
text/html;level=3 = 0.7
level
的值用于降低优先级(1具有最高优先级,2具有第二高优先级,等等)。这是有道理的,但是当与
Accept:
header 一起使用时,这根本没有任何意义:
q
参数在关联中(以下)从类型中神奇消失了。就像作者以为很明显为什么省略了它们,却忘了告诉我们为什么很明显了。 Accept:
header 中的类型与关联中显示的类型(如下所示)不是相同的类型。例如, header 中从未提到image/jpeg
类型,并且关联中缺少text/*
类型。 level
parameter上,有一些有趣的东西。
q
和
level
相互补充
[...] The q-factor is the one most looked at. However, you can also specify a "level", and these CAN also act like priorities, but operate in the order of decreasing precedence (i.e., level 1 is higher priority than level 2). The examples they have in the spec are contrived, and, tbh, confusing at best [...]
q
参数,并且可以使用
level
参数。好的,但是它仍然不能完全弄清它的作用以及应该如何影响类型的优先级。
Another documented use case for the "level" is to indicate the _version_ of the type. As an example, a "level 1" might indicate the first version of that spec available. In such cases, it wouldn't be a priority, but instead a _descriptor_ [...]
text/html;level=5;q=1
text/html;level=4.01;q=0.9
; Etc.
level
是否应该用于此目的。如果是这样的话,它可能会被称为更具描述性的内容,例如
version
,或者简称为
v
(例如
q
)。
Unfortunately, the "level" selector has conflicting meanings, so I'm not 100% sure we should support it by default; "q", on the other hand, is well documented.
level
属性几乎没有用。
level
的
mxs
和mxb
。 Accept
header 。无处使用level
。实际上,我从未见过它在RFC之外使用。 level
是浪费时间。它的文献记录不充分,在实践中很少使用(如果真的使用过的话),而且比它值得的还令人困惑。
关于HTTP接受 "level"吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13890996/
我是业余时间的 Java 开发者,我只是想知道 level.tick() 和 Level.tick(level) ('Level' 是类的名称,'level' 是该类的对象) 我知道,由于 java
在 asp.net MVC 中的 Level Views Level 或 Model level 中验证更明智 以及有关 MVC 中验证的良好教程的链接? 最佳答案 验证应始终在可能的情况下在客户端和
当使用随机数生成器时,为了使新值具有更大的随机性,这是更好的使用方式: 有没有一种每次都实例化一个新的 RNG 实例然后返回一个值的方法? 在类级别有一个 RNG 实例,它在构造函数中实例化一次,并且
我在理解“单一责任原则”时遇到问题。应该在类级别或方法级别应用SRP。 可以说我有学生类,我需要创建学生,更新学生和删除学生。 如果我创建一个具有用于这三个操作的方法的服务类,则会违反SRP原则。 最
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
这个问题与语言无关。枚举级别之间有什么区别。在应用程序中,我看到许多 INFO 消息对我来说似乎是 DEBUG 信息,反之亦然。 最佳答案 对此有多种不同的解释。我个人的看法是: 信息 - 与申请状态
似乎最好只为顶级函数创建一次 FunPtr,而不是在需要时创建一个新的函数(同一函数)并处理其释放。 除了 foreign import ccall "wrapper" 之外,我是否忽略了获取 Fun
我正在经历以下 link了解在依赖倒置原则的背景下高级和低级模块的含义。 根据那里给出的解释,以下代码片段是一个好的/合适的示例吗? public class HighLevel { priv
我很好奇在 Java 应用程序中执行 URL 重写的最佳方法是什么。假设您有一个名为 test_app 的应用程序,我将其部署在 tomcat 上。 通过 URL 重写,我的意思是我不想通过 host
我试图找到最有效的方法来检查给定的字符串是否为回文。 首先,我尝试了蛮力,其运行时间为 O(N)。然后我通过只进行 n/2 次比较而不是 n 次来稍微优化代码。 代码如下: def palindrom
我有一个包含一些随机自然数的表格,例如: number ------- 2 3 1 我想从这个表中检索一个集合,其中每一行都将包含与值显示的次数一样多的次数,例如上面它将是: number -----
我一直在了解测试驱动开发的优势,并尝试使用 pytest 开发我的第一个 TDD 应用程序和 setuptools 开发 选项。到目前为止进展顺利。我有一个问题:我的 test_* 模块中应该将要测试
我想将特定记录器名称、特定级别或更高级别(比如 INFO 及以上)的消息记录到特定的日志处理程序,比如文件处理程序,同时仍然获取所有日志消息到控制台。 Python 是 2.7 版。 到目前为止我尝试
DOM Level 0 事件与 DOM Level 2 事件有什么区别?我问是因为有人告诉我 Firefox 和 IE 以不同的顺序调用它们,而我以前从未听过这些术语。 最佳答案 DOM Level
其实我对token不是很了解..当我阅读 googleresearch/bert model 时,我看到了这些词。 # In the demo, we are doing a simple class
假设我们在站点中有一个页面,它显示了数据库中的一些记录。 我们需要显示按某列排序的记录。 哪种方法可以提供更好的性能:检索从数据库中排序的数据或在网格上应用排序? 谢谢 最佳答案 这取决于您要显示的数
其实我对token不是很了解..当我阅读 googleresearch/bert model 时,我看到了这些词。 # In the demo, we are doing a simple class
我有以下 CSS 下拉菜单标记: FieldOne LevelOne FieldTwo LevelOne FieldThree LevelOne
这个问题已经有答案了: What is the difference between DOM Level 0 events vs DOM Level 2 events? (2 个回答) 已关闭 9 年
如何通过搜索数组(第 2 级)中的重复值来删除一行数组(第 1 级)? $array = array( 0 => array('name' => 'haha1', 'dateline' => '
我是一名优秀的程序员,十分优秀!