## 分頁
請求某個資源集合時,可以通過指定?`count`?參數來指定每頁的資源數量,通過?`page`?參數指定頁碼,或根據?`last_cursor`?參數指定上一頁最后一個資源的標識符。
如果沒有傳遞?`count`?參數或者?`count`?參數的值為空,則使用默認值 20 ,?`count`?參數的最大上限為 100 。
如何同時傳遞了?`last_cursor`?和?`page`?參數,則使用?`page`?。
分頁的相關信息會包含在?[Link Header](http://tools.ietf.org/html/rfc5988)?和?`X-Total-Count`?中。
如果是第一頁或者是最后一頁時,不會返回?`previous`?和?`next`?的 Link 。
~~~
HTTP/1.1 200 OK
X-Total-Count: 542
Link: <http://api.example.com/#{RESOURCE_URI}?last_cursor=&count=100>; rel="first",
<http://api.example.com/#{RESOURCE_URI}?last_cursor=200&count=100>; rel="last"
<http://api.example.com/#{RESOURCE_URI}?last_cursor=90&count=100>; rel="previous",
<http://api.example.com/#{RESOURCE_URI}?last_cursor=120&count=100>; rel="next",
[
...
]
~~~
相關資料:
* [RFC 5005 第3節?*Paged Feeds*](http://tools.ietf.org/html/rfc5005#section-3)
* [RFC 5988 6.2.2節?*Initial Registry Contents*](http://tools.ietf.org/html/rfc5988#section-6.2.2)