REST (Representational State Transfer)

Postman
https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo?hl=en-US

https://dzone.com/storage/assets/3713530-dzone-refcard129-restfularchitectureupdated.pdf
http://www.vogella.com/tutorials/REST/article.html
https://www.youtube.com/watch?v=7YcW25PHnAA
http://www.sitepoint.com/creating-restful-apis-express-4/
http://www.sitepoint.com/best-practices-rest-api-scratch-implementation/
https://www.sitepoint.com/best-practices-rest-api-scratch-introduction

http://net.tutsplus.com/tutorials/other/a-beginners-introduction-to-http-and-rest/

http://www.infoq.com/articles/rest-introduction
http://www.infoq.com/articles/webber-rest-workflow

http://www.xfront.com/REST-Web-Services.html
http://bitworking.org/news/373/An-Introduction-to-REST
http://en.wikipedia.org/wiki/Representational_State_Transfer
http://www.rfc-editor.org/rfc/rfc5785.txt - RFC 5785 Defining Well-Known Uniform Resource Identifiers (URIs)
https://github.com/expressjs/express-resource
https://www.youtube.com/watch?v=xkKcdK1u95s

What does REST abbreviate for?

Representational State Transfer

Who invented REST?

Roy Thomas Fielding - http://www.ics.uci.edu/~fielding/

What are the key concepts covered in REST?

In a RESTful application, think of components of your application as resources, and HTTP verbs as actions for manipulating and accessing those resources.

  1. Resources: Application state and functionality are abstracted into resources. Every resource is uniquely addressable via a global identifier (URI in HTTP). All resources share a uniform interface for transfer of state between client and server. Resource consists of a constrained set of well defined operations. Resource consists of a constrained set of content types, each optionally supporting code on demand. A resource may have multiple representation.
  2. Protocol:
    1. REST consist of a protocol which is client-server, stateless, cacheable, layered. HTTP separates the notions of a web server and a web browser. This allows the implementation of each to vary from the other based on the client-server principle. When used RESTfully, HTTP is stateless. Each message contains all the information necessary to understand the request. As a result, neither the client nor the server needs to remember any state between messages. (Other articles indicate that state can be maintained on the client side, but not on the server side).
    2. In order to manipulate these resources, components of the network communicates via standardized interface (HTTP). Any connector (components, servers, caches, tunnels, firewalls, etc.) can mediate the request. An application can interact with a resource by knowing two things: the identifier of the resource, and the action required. It does not need to know whether there are caches, proxies, gateways, firewalls, tunnels, or anything else between it and the server actually holding the information. The application does, however, need to understand the format of the information returned.
    3. REST's client-server separation of concerns simplifies component implementation, reduces the complexity of connector semantics, improves the effectiveness of performance tuning, and increase scalability of pure server components. Layered system allow intermediaries — proxies, gateways, and firewalls — to be introduced at various points in the communication without changing the interfaces between components, thus allowing them to assist in communication translation or improve performance via large-scale, shared caching. REST enables intermediate processing by constraining messages to be self-descriptive: interaction is stateless between requests, standard methods, and media types are used to indicate semantics and exchange information, and response explicitly indicate cacheability.

What are the HTTP verbs?

  • GET: Use to implement the Read portion of a CRUD application
  • POST: Use to implement the Update portion of a CRUD application
  • PUT: Used to implement the Create portion of a CRUD application
  • DELETE: Used to implement the Delete portion of a CRUD application

What are the actions of an resource in a RESTful application?

  1. index
  2. new: Display the form for the user to create a new resource
  3. create: Handle the actual creation of the resource
  4. show
  5. edit
  6. update
  7. destroy
GET     /forums              ->  index
GET     /forums/new          ->  new
POST    /forums              ->  create
GET     /forums/:forum       ->  show
GET     /forums/:forum/edit  ->  edit
PUT     /forums/:forum       ->  update
DELETE  /forums/:forum       ->  destroy
GET    /movies    -> find
POST    /movies    -> create
PUT    /movies/:id    -> update
GET    /movies/:id    -> findOne
DELETE    /movies/:id    -> delete

What are other client-server technologies that REST is typically compared against?

  1. RPC vs REST
  2. SOAP vs REST
  3. SOA vs REST

What are some remaining questions?

  1. How can we design a RESTful banking application? Look at the smaller stuffs. A banking applications involves the following objects: users, user preferences, accounts. These can be created, added, edited
  2. How can we design a RESTful medical application? Similar to designing a RESTful banking application.
  3. What are the pros and cons of using REST?
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License