How can we handle empty collection on a RESTful interface, with Content-Range's items header?
For instance, having 42 records, a request Range: items=0-41
would return everything, and the response header would be: Content-Range: items 0-41/42
.
However, how can we deal with Content-Range
header when there is not any records? Thanks for any help.
Edit:
I mean, returning an empty collection, the server may want to return Content-Range: items x-y/0
, where x
and y
are a value which would be different than 0. But which one? I think this is a sticky question, and the spec does not mention it.
Actually the server should respond with an HTTP 416 Request Not Satisfiable, with Content-Range: */0
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With