Example
Run this code in a console or from any site:
fetch('/todos/1')
.then(response => response.json())
.then(json => console.log(json))
Congrats you've made your first call! 😃 🎉
Resources
| /posts | 100 posts |
| /comments | 500 comments |
| /albums | 100 albums |
| /photos | 5000 photos |
| /todos | 200 todos |
| /users | 10 users |
Note: resources have relations. For example: posts have many comments, albums have many photos, ... see below for routes examples.
Routes
All HTTP methods are supported.
| GET | /posts |
| GET | /posts/1 |
| GET | /posts/1/comments |
| GET | /comments?postId=1 |
| GET | /posts?userId=1 |
| POST | /posts |
| PUT | /posts/1 |
| PATCH | /posts/1 |
| DELETE | /posts/1 |
Note: you can view detailed examples here.