Skip to content

Commit

Permalink
Added documentation for the REST layer how to use POST actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
asteitz committed Jul 25, 2012
1 parent a201020 commit ddf9373
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions framework/source/class/qx/io/rest/Resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,20 @@
* <pre class="javascript">
* var description = {
* "get": { method: "GET", url: "/photo/{id}" },
* "put": { method: "PUT", url: "/photo/{id}"}
* "put": { method: "PUT", url: "/photo/{id}"},
* "post": { method: "POST", url: "/photos/"}
* };
* var photo = new qx.io.rest.Resource(description);
* photo.get({id: 1}); // Can also be written: photo.invoke("get", {id: 1});
* photo.put({id: 1}, {title: "Monkey"}); // Additionally sets request data
* // Can also be written: photo.invoke("get", {id: 1});
* photo.get({id: 1});
*
* // Additionally sets request data
* // In a RESTful environment this creates a new resource with the given 'id'
* photo.put({id: 1}, {title: "Monkey"});
*
* // Additionally sets request data
* // In a RESTful environment this adds a new resource to the resource collection 'photos'
* photo.post(null, {title: "Monkey"});
* </pre>
*
* To check for existence of URL parameters or constrain them to a certain format, you
Expand Down

0 comments on commit ddf9373

Please sign in to comment.