Paging in a Rest Collection

前端 未结 12 1823
走了就别回头了
走了就别回头了 2020-12-02 03:37

I\'m interested in exposing a direct REST interface to collections of JSON documents (think CouchDB or Persevere). The problem I\'m running into is how to handle the G

12条回答
  •  醉梦人生
    2020-12-02 04:15

    You can detect the Range header, and mimic Dojo if it is present, and mimic Atom if it is not. It seems to me that this neatly divides the use cases. If you are responding to a REST query from your application, you expect it to be formatted with a Range header. If you are responding to a casual browser, then if you return paging links it will let the tool provide an easy way to explore the collection.

提交回复
热议问题