Using RESTful APIs

In notebook:
FrontEndMasters BackboneJS
Created at:
libraries JavaScript backend
Talks about Rest:
  • A way to architect data and the traffic that acts on that data
  • Communicates what resource you are trying to access and what you want to do with that resource, through a URL
  • Components of a request: type (POST, GET, DELETE, PATCH, etc. and resource, the actual url)
  • GET /users (request only, should not have side effects)
  • POST /users/1, data: { first_name: “Donald” }
Rest is just an easy to follow, set of conventions. There are frameworks for Rails that create these automatically.
Why ​listento​ preferred to ​on​ : it’s about memory management. When you destroy views ​listento​ event listeners will be cleaned up automatically.