Why most API paginations do not rely on HTTP Range header?

前端 未结 2 2162
小鲜肉
小鲜肉 2021-02-20 14:13

I\'ve searched a lot but I can\'t find a good answer to this question. Being a HATEOAS aficionado, I would think that this header fit perfectly:

    Range: item=         


        
2条回答
  •  日久生厌
    2021-02-20 15:13

    Most of the times you don't want to show all of your items by default. With ?p=2 style pages it's ok to reserve root / for first page. With "Range" header it would be strange behavior. HTTP became overbloated long time ago so I wouldn't recommend to accept every its headers as Truth.

提交回复
热议问题