Open alekitto opened 4 years ago
Indeed, HTTP headers could be used. Can you point out the Accept-Ranges
and Range
in the standard?
Agree also for the X-Order
header. Much better probably than specify an OrderColumn
that overrides the order
name (or using another one)
Range
: https://tools.ietf.org/html/rfc7233#section-3.1 (here's the MDN article: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range)
Accept-Ranges
: https://tools.ietf.org/html/rfc7233#section-2.3 (MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Ranges)
As you can see in the IANA HTTP Range Unit Registry only bytes
and none
are registered units. All others range specification are usable.
HTTP headers could be used for pagination (and ordering) in a more RESTful way.
Standard
Accept-Ranges
andRange
HTTP header could be used to paginate lists. My proposal is to adopt two custom units for ranges:units
orresources
for limit-offset paginationafter
orcontinue
for passing a continuation tokenA custom
X-Order
header could be introduced to set the list order, allowing anorder
field to be freely filtered without name collisions. In this case the header should have the following format: