HTTP Methods (5)

HTTP Headers (1)

Miscellaneous (3)

Resources (4)

Basics (5)

Mediatypes (1)


不要使用像添加一个分页码到 URL 或者 query string 中这样的自定义的分页系统,相反,使用关系链接。

GET /collection HTTP/1.1

HTTP/1.1 200 OK
    <article id="1">...</article>
    <article id="2">...</article>
    <article id="3">...</article>
    <article id="4">...</article>
    <article id="5">...</article>
        <link rel="self" href="/collection" title="Current page"/>
        <link rel="next" href="/collection/2" title="Next page"/>
        <link rel="first" href="/collection/1" title="First page"/>
        <link rel="last" href="/collection/5" title="Last page"/>

当客户端希望浏览下一个分页集合,它可以通过「next」关系链接来获得。这是 IANA 定义的标准关联类型。



Copyright 2012 Joshua Thijssen and others. Like to contribute? Add your recipe to our github repository.
Looking for Puppet recipies? Try the Puppet CookBook.
Fork me on GitHub