Upgrade to Pro — share decks privately, control downloads, hide ads and more …

REST for the rest of us

REST for the rest of us

I try to make sense of the Representation State Transfer architectural style introduced by Roy Fielding, one of the original authors of HTTP 1.1

Antonio Ognio

October 27, 2013
Tweet

More Decks by Antonio Ognio

Other Decks in Programming

Transcript

  1. REST for the rest of us or “Roy Fielding Ever

    Said That!?” Antonio Ognio // Lima, Perú Red Científica Peruana @gnrfan
  2. VERB A KIND OF ACTION TO PERFORM OVER A RESOURCE

    THAT CAN POTENTIALLY ALTER THE STATE OF THE SYSTEM
  3. 202 ACCEPTED THE OPERATION YOU REQUESTED HAS BEEN ACCEPTED FOR

    PROCESSING. PLEASE POLL THE LINKED RESOURCE TO LEARN ABOUT THE PROGRESS.
  4. 401 UNAUTHORIZED PLEASE, AUTHENTICATE SO WE CAN TELL IF YOU

    ARE AUTHORIZED OR NOT TO ACCESS THE RESOURCE
  5. 404 NOT FOUND THE RESOURCE LOCATED AT THE PROVIDED URI

    DOES NOT EXISTS (AT LEAST FOR YOU)
  6. 405 METHOD NOT ALLOWED THE RESOURCE DOES NOT SUPPORT THE

    VERB YOU ARE TRYING TO USE AGAINST IT
  7. 406 NOT ACCEPTABLE SORRY, WE CAN’T PROVIDE A REPRESENTATION FOR

    THE RESOURCE USING ANY OF THE MEDIA TYPES YOU ACCEPT
  8. 409 CONFLICT SORRY, THERE IS A CONFLICT WITH THE CURRENT

    STATE OF THE RESOURCE AND THE NEW STATE IT WOULD HAVE IF WE PERFORM THE REQUESTED OPERATION
  9. RESTFUL HTTP APIs Web services that take full advantage of

    an specific incarnation of REST (HTTP) and it’s full ecosystem
  10. Github HTTP APIs use: - Their own media types -

    JSON-based hypermedia - Full URIs to every resource - Home documents with links - Useful metadata in the headers
  11. Github also provides: - Connectors: Client libraries for many languages

    - Components: Desktop and mobile-based user agents for different platforms
  12. “Pragmatic REST”: - Don’t use custom media types - Don’t

    include full URIs of resources - Don’t use home documents - Don’t include metadata as headers
  13. REST for the rest of us or “Roy Fielding Ever

    Said That!?” Antonio Ognio // Lima, Perú Red Científica Peruana @gnrfan