1
0
Fork 0
lets-talk-apis/slides/a-restful-example.md

17 lines
578 B
Markdown
Raw Permalink Normal View History

2015-10-12 14:36:14 -04:00
## A RESTful Example
2015-10-13 15:45:59 -04:00
[Simple example](http://lets-talk-apis.herokuapp.com/jokes)
2015-10-12 14:36:14 -04:00
2015-10-12 17:11:41 -04:00
* List: GET /jokes
* Create: POST /jokes
* Show: GET /jokes/1
* Update: PUT /jokes/1
* Delete: DELETE /jokes/1
note:
2015-10-13 14:58:13 -04:00
curl http://lets-talk-apis.herokuapp.com/jokes
curl -X POST --data 'joke[joke]=Why did the chicken get to the other side&joke[punchline]=To get to the other side' http://lets-talk-apis.herokuapp.com/jokes
curl -X PUT --data 'joke[joke]=New Joke&joke[punchline]=Punchline' http://lets-talk-apis.herokuapp.com/jokes/1
curl -X DELETE http://lets-talk-apis.herokuapp.com/jokes/1