本文介绍了将Accept-Encoding字段留空是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现Accept-Encoding的例子违反了文档中的规范:

I found the example of Accept-Encoding violates the specification in the document:

Accept-Encoding标题字段定义如下:

The "Accept-Encoding" header field is defined as below:

   Accept-Encoding  = "Accept-Encoding" ":"
                      1#( codings [ ";" "q" "=" qvalue ] )

所以根据 1#(...)的语法,它应该在值列表中至少包含一个元素。但其中一个例子是:

So according to the syntax of 1#(...), it should contain at least one element in the value list. But one of the examples comes after it is:

   Accept-Encoding:

它有一个空值部分。我错过了什么吗?并且有人能告诉我这个用法是否有效?

It has a blank value part. Did I miss anything? And could anyone tell me is this usage valid or not?

推荐答案

你真的应该停止查看RFC 2616.参见,是的,空字段值有效。

The answer to your question is here: http://trac.tools.ietf.org/wg/httpbis/trac/ticket/25, so yes, an empty field value is valid.

这篇关于将Accept-Encoding字段留空是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-15 07:20