Skip to content

Commit 459ddf5

Browse files
committed
Add pagination
1 parent a9fc25c commit 459ddf5

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ GET /posts?id=1&id=2
8585
GET /comments?author.name=typicode
8686
```
8787

88-
### Slice
88+
### Paginate
8989

90-
Add `_start` and `_end` or `_limit` (an `X-Total-Count` header is included in the response)
90+
Add `_page` and in the `Link` header you'll get `first`, `prev`, `next` and `last` links
9191

9292
```
93-
GET /posts?_start=20&_end=30
94-
GET /posts/1/comments?_start=20&_end=30
95-
GET /posts/1/comments?_start=20&_limit=10
93+
GET /posts?_page=7
9694
```
9795

96+
_10 items are returned by default_
97+
9898
### Sort
9999

100100
Add `_sort` and `_order` (ascending order by default)
@@ -104,6 +104,16 @@ GET /posts?_sort=views&_order=DESC
104104
GET /posts/1/comments?_sort=votes&_order=ASC
105105
```
106106

107+
### Slice
108+
109+
Add `_start` and `_end` or `_limit` (an `X-Total-Count` header is included in the response)
110+
111+
```
112+
GET /posts?_start=20&_end=30
113+
GET /posts/1/comments?_start=20&_end=30
114+
GET /posts/1/comments?_start=20&_limit=10
115+
```
116+
107117
### Operators
108118

109119
Add `_gte` or `_lte` for getting a range

0 commit comments

Comments
 (0)