Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed May 12, 2014
1 parent 44a6032 commit ca461d2
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ I hope you will find it useful.
* "Has many" relationships
* Filters and nested resources
* Cross-domain ([CORS](http://en.wikipedia.org/wiki/Cross-origin_resource_sharing) and [JSONP](http://en.wikipedia.org/wiki/JSONP))
* Supports GET, POST, PUT and DELETE verbs
* Supports GET, POST, PUT, PATCH, DELETE and OPTIONS verbs
* Compatible with Backbone, AngularJS, Ember, ...

## Available resources
Expand Down Expand Up @@ -102,7 +102,6 @@ Note: the resource will not be really created on the server but it will be faked
### Updating a resource

```javascript
// PUT returns the object sent
$.ajax('http://jsonplaceholder.typicode.com/posts/1', {
method: 'PUT',
data: {
Expand All @@ -125,6 +124,26 @@ $.ajax('http://jsonplaceholder.typicode.com/posts/1', {
*/
```

```javascript
$.ajax('http://jsonplaceholder.typicode.com/posts/1', {
method: 'PATCH',
data: {
title: 'foo'
}
}).then(function(data) {
console.log(data);
});

/* will return
{
id: 1
title: 'foo',
body: 'quia et suscipit [...]',
userId: 1
}
*/
```

Note: the resource will not be really updated on the server but it will be faked as if.

### Deleting a resource
Expand Down

0 comments on commit ca461d2

Please sign in to comment.