/**
* Representational State Transfer
*
* @author Roy Thomas Fielding
* @date 2000
*/
Rest.prototype = new ArchitecturalStyle();
POST /findBikesByStation?id=1234
200 [1000,5234,2345]
POST /rentBike/1000
200
POST /stations/1234/bikes
200 [1000,5234,2345]
POST /bikes/1000/rentBike
200
GET /stations/1234/bikes
200 [1000,5234,2345]
POST /bikes/9999/rents
200 {"error":"already rented"}
GET /stations/1234/bikes
200 [1000,5234,2345]
POST /bikes/9999/rents
409
POST /bikes/1000/rents
301 Location: /bikes/1000/rents/7788
POST /bikes/1000/rents
301 Location: /bikes/1000/rents/7788
{"content": {"start": "2014-06-23T18:45"},
"links":[
{ "rel": "self", "method": "get", "href": "/bikes/1000/rents/7788"},
{ "rel": "return", "method": "delete", "href": "/bikes/1000/rents/7788"},
{ "rel": "bike", "method": "get", "href": "/bikes/1000"}
]}
POST /bikes/1000/rents
rel | method | href |
---|---|---|
self | get | /bikes/1000/rents/7788 |
return | delete | /bikes/1000/rents/7788 |
bike | get | /bikes/1000 |