title: Content-Range header - allowed units?
body: <p>This is related to:
  <a href="https://stackoverflow.com/questions/5393558/how-should-i-implement-a-count-verb-in-my-restful-web-service">How should I implement a COUNT verb in my RESTful web service?</a> , <a href="https://stackoverflow.com/questions/924472/paging-in-a-rest-collection">Paging in a Rest Collection</a>
  and <a href="https://stackoverflow.com/questions/1434647/using-the-http-range-header-with-a-range-specifier-other-than-bytes">Using the HTTP Range Header with a range specifier other than bytes?</a></p>
  
  <p>Actually I think the -1 rated anwser here is correct <a href="https://stackoverflow.com/a/1434701/1237617">https://stackoverflow.com/a/1434701/1237617</a></p>
  
  <p>Generally anwsers say that you can use custom units citing the sec 3.12</p>
  
  <pre><code>  range-unit       = bytes-unit | other-range-unit
    bytes-unit       = "bytes"
    other-range-unit = token
  </code></pre>
  
  <p>However when you read the HTTP spec please notice the production rules are thus:</p>
  
  <pre><code>   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 | "*" )
  </code></pre>
  
  <p>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.</p>
  
  <p>Am I missing something or is the popular anwser wrong?</p>
  
  <p>EDIT: 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.</p>
  
  <p>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).</p>
  
  <blockquote>
    <p>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</p>
  </blockquote>
  
  <p>thanks to elgaton</p>