内容Range头 - 允许单位? [英] Content-Range header - allowed units?
问题描述
这是有关:
<一href=\"http://stackoverflow.com/questions/5393558/how-should-i-implement-a-count-verb-in-my-restful-web-service\">How要我在RESTful Web服务在休息集合实现COUNT动词?,寻呼
和<一个href=\"http://stackoverflow.com/questions/1434647/using-the-http-range-header-with-a-range-specifier-other-than-bytes\">Using在HTTP范围标头比其他字节范围说明?
其实我觉得-1额定这里anwser是正确的 http://stackoverflow.com/a/1434701/1237617
Actually I think the -1 rated anwser here is correct http://stackoverflow.com/a/1434701/1237617
一般anwsers说,你可以使用自定义单位援引秒3.12
Generally anwsers say that you can use custom units citing the sec 3.12
range-unit = bytes-unit | other-range-unit
bytes-unit = "bytes"
other-range-unit = token
然而,当你阅读HTTP规范,请注意生产规则是这样的:
However when you read the HTTP spec please notice the production rules are thus:
Content-Range = "Content-Range" ":" content-range-spec
content-range-spec = byte-content-range-spec
byte-content-range-spec = bytes-unit SP
byte-range-resp-spec "/"
( instance-length | "*" )
头规格仅从秒3.12引用字节单位,而不是范围单元,因此,我认为,实际上这是违反规范在这里使用自定义单位。
The header spec only references bytes-unit from sec 3.12, not range-units, so I think that actually it's against the spec to use custom units here.
我缺少的东西或者是流行的anwser错了?
Am I missing something or is the popular anwser wrong?
编辑:由于这probbably是不明确的,我的问题的要点是:
RFC2616 sec14.16只引用字节单位。它从来没有提到范围单元,所以范围单元的生产是不相关的内容范围,并且可以使用这样仅字节单位
Since this probbably isn't clear, the gist of my question is: rfc2616 sec14.16 only references bytes-unit. It never mentions range-unit, so range-unit production is not relevant for Content-Range, and thus only byte-units can be used.
我觉得这个我不会忽略的担忧最好的,虽然我需要一些时间来了解它(加上我想确保,这有什么不对的写法)。
I think this adresses my concerns best, although I needed some time to understand it (plus I wanted to make sure, that there is something wrong with the wording).
这反映了,显然,第一组的语法规则是专门用于分析作出的事实,第二个用于产生HTTP请求
This reflects the fact that, apparently, the first set of grammar rules has been specifically made for parsing and the second one for producing HTTP requests
由于elgaton
推荐答案
的规范,如正在修改,允许自定义范围内的单位。请参见 HTTPbis 5部分,第2节一>
The spec, as being revised, allows custom range units. See HTTPbis Part 5, Section 2.
这篇关于内容Range头 - 允许单位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!