RailsConf 2007 - Doing REST Right

Posted by Jake Good
on May 18, 07

Getting better…



My expectations for this talk was to get deeper into Ruby code… and I was quite suprised to see some (yet) more high level overviews of concepts.



There are three things to think about when talking REST:



Address - Interaction - Content



Address: My Name is URL (el-oh-el). Easy, this is the URL of the resource… a resource is just a name and a URL matches this perfectly. You’ll want the resource to have a very small and concise contract (hint, interaction).



Interaction: the Uniform Interface… using HTTP Protocol to lower and solidify the expectations of interactions (GET, POST, PUT, DELETE)



Content: simple content types and data. Keep it simple. vCard… etc.



The juicy core of the presentation came when he addressed several questions that he has recieved and what the RESTful response (har har har) would be to those questions…



Some that came up that were interesting:



1) Updating several resources at once - Just abstract that group of resources into another higher level resource. Same with partial results, reliability, transactions, and concurrency can all be taken care of by abstraction.



2) Authentication RESTfully - use cookies, just store all session stuff on the cookie instead of duplicating it and having the server manipulate it’s own state based on it.

Comments

Leave a response

Comment