diff --git a/resources/api.png b/resources/api.png new file mode 100644 index 0000000..034bbde Binary files /dev/null and b/resources/api.png differ diff --git a/slides/a-restful-example.md b/slides/a-restful-example.md index 99b3c0d..0f071a2 100644 --- a/slides/a-restful-example.md +++ b/slides/a-restful-example.md @@ -1,9 +1,15 @@ ## A RESTful Example -Some site with example +Simple sample -* List: GET /resource -* Create: POST /resource -* Show: GET /resource/1 -* Update: PUT /resource/1 -* Delete: DELETE /resource/1 +* List: GET /jokes +* Create: POST /jokes +* Show: GET /jokes/1 +* Update: PUT /jokes/1 +* Delete: DELETE /jokes/1 + +note: + +curl --data 'joke[joke]=Why did the chicken get to the other side&joke[punchline]=To get to the other side' http://localhost:9292/jokes +curl -X PUT --data 'joke[joke]=New Joke&joke[punchline]=Punchline' http://localhost:9292/jokes/1 +curl -X DELETE http://localhost:9292/jokes/1 diff --git a/slides/api-documentation.md b/slides/api-documentation.md new file mode 100644 index 0000000..e9315d6 --- /dev/null +++ b/slides/api-documentation.md @@ -0,0 +1,3 @@ +## API Documentation + +![API Guide](resources/api.png) diff --git a/slides/index.md b/slides/index.md index 28a7953..19d9a5c 100644 --- a/slides/index.md +++ b/slides/index.md @@ -1,4 +1,6 @@ # Let's Talk APIs +Well...RESTful ones anyway + Andrew Tomaka / [@atomaka](https://twitter.com/atomaka) diff --git a/slides/list.json b/slides/list.json index d691e40..ef8c295 100644 --- a/slides/list.json +++ b/slides/list.json @@ -1,10 +1,12 @@ [ "index.md", "what-is-an-api.md", + "api-documentation.md", "make-it-restful.md", "rest-constraints.md", "rest-on-the-web.md", "a-restful-example.md", + "sample-code.md", "resources.md", "other-talks.md" ] diff --git a/slides/make-it-restful.md b/slides/make-it-restful.md index 449c423..b95b8a1 100644 --- a/slides/make-it-restful.md +++ b/slides/make-it-restful.md @@ -3,3 +3,5 @@ * **RE**presentational * **S**tate * **T**ransfer + +Constraints to create consistent APIs diff --git a/slides/rest-on-the-web.md b/slides/rest-on-the-web.md index b43e0e6..b2952b1 100644 --- a/slides/rest-on-the-web.md +++ b/slides/rest-on-the-web.md @@ -4,6 +4,8 @@ * Pick a data type (JSON, XML, Atom, etc) * Use standard HTTP methods * GET, PUT, POST, DELETE, (and PATCH) +* Use standard HTTP response codes + * 200 OK, 204 No Content, 404 Not Found -notes: +note: diff --git a/slides/restful-responses.md b/slides/restful-responses.md new file mode 100644 index 0000000..3a3f025 --- /dev/null +++ b/slides/restful-responses.md @@ -0,0 +1,12 @@ +## HTTP Responses + +* 200 OK: Request succeeded and information returned +* 204 No Content: Request succeeded but no information returned +* 404 Not Found: Resource not found +* 422 Unprocessable Entity: Incorrect semantics + +[And many others](http://www.restapitutorial.com/httpstatuscodes.html) + +note: + +422 ex: strong params violation diff --git a/slides/sample-code.md b/slides/sample-code.md new file mode 100644 index 0000000..023c37a --- /dev/null +++ b/slides/sample-code.md @@ -0,0 +1 @@ +## Sample Code