Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination? #27

Closed
antoniputra opened this issue Apr 26, 2016 · 3 comments
Closed

Pagination? #27

antoniputra opened this issue Apr 26, 2016 · 3 comments

Comments

@antoniputra
Copy link

is there a configuration to doing pagination?

something like:
http://jsonplaceholder.typicode.com/posts?page=2&limit=10&sort=latest

@typicode
Copy link
Owner

Hi @antoniputra,

You can use _start and _limit:
http://jsonplaceholder.typicode.com/posts?_start=10&_limit=10

There's also a custom header X-Total-Count in the response.

@antoniputra
Copy link
Author

Awesome. 👍

@firxworx
Copy link

I came across this when searching if/how the JSONPlaceholder API supported paging.

I implemented a codesandbox example that uses the _page and _limit parameters to implement paging:

https://codesandbox.io/s/api-pagination-with-react-router-hooks-i0912

In general, the API supports everything implemented by JSON Server. You can check that project's README/docs for paging/sort/filter/search related parameters: https://github.com/typicode/json-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants