RESTful Design: Paging Collections

后端 未结 3 806
遇见更好的自我
遇见更好的自我 2021-02-04 06:57

I am designing a REST api that needs paging (per x) enforces from the server side.

What would be the right way to page through any collection of resources:

Optio

3条回答
  •  情话喂你
    2021-02-04 07:55

    With my limited understanding of what REST is about, then the following might be the "most" restful.

    GET /resource/?page=&asof=
    

    Since the content of the representation would never change unexpectedly, and caching could be used.

    But to actually answer your question, I think the parameter page is the preferred method.

提交回复
热议问题