JSONPlaceholder
It's great for tutorials, faking a server, sharing code examples, ...
Example
Run this code in a console or from anywhere (CORS and JSONP supported).var root = 'https://jsonplaceholder.typicode.com';
$.ajax({
url: root + '/posts/1',
method: 'GET'
}).then(function(data) {
console.log(data);
});
Response example
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto"
}
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit suscipit recusandae consequuntur expedita et cum reprehenderit molestiae ut ut quas totam nostrum rerum est autem sunt rem eveniet architecto"
}
Resources
Inspired by common use cases.| /posts | 100 items |
| /comments | 500 items |
| /albums | 100 items |
| /photos | 5000 items |
| /todos | 200 items |
| /users | 10 items |
Routes
All HTTP verbs are supported.View usage examples.
| 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 |

Comments
Post a Comment