Friday, May 30, 2014

Notes - Rails Tutorial Chapter 5 - REST

REST architecture
wiki defines REST as:
Representational state transfer (REST) is a software architectural style consisting of a coordinated set of architectural constraints applied to components, connectors, and data elements, within a distributed hypermedia system.

What???
As condescending as this is it is also a helpful explanation:
http://katgleason.tumblr.com/post/37836552900/how-i-explained-rest-to-my-wife

https://www.servage.net/blog/2013/04/08/rest-principles-explained/

http://rest.elkstein.org/

http://www.railstutorial.org/book/demo_app#table-demo_RESTful_users
HTTP requestURLActionPurpose
GET/usersindexpage to list all users
GET/users/1showpage to show user with id 1
GET/users/newnewpage to make a new user
POST/userscreatecreate a new user
GET/users/1/editeditpage to edit user with id 1
PATCH/users/1updateupdate user with id 1
DELETE/users/1destroydelete user with id 1

No comments:

Post a Comment