Skip to content

Instantly share code, notes, and snippets.

@geoapi
Forked from dwayne/00-introduction.md
Last active September 24, 2017 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geoapi/d4411891ce892d1445d98a4b3231e7cf to your computer and use it in GitHub Desktop.
Save geoapi/d4411891ce892d1445d98a4b3231e7cf to your computer and use it in GitHub Desktop.
How to build a Hypermedia-Driven REST API - Notes

Does it the "wrong" way so we can learn why the "right" way maybe better.

Builds an "RPC style" API which in this case means that all requests will come in the form of POST requests and all responses would be returned in the body.

Tools

The current "RPC style" API works but it is:

  • Messy
  • Hard to maintain
  • Not discoverable

New problems with the API after building a REST Level 1 version:

  • Not taking advantage of HTTP verbs, GET, POST, PUT, PATCH, DELETE etc
  • Not taking advantage of the HTTP status codes, return 200 OK for everything including errors

Resources

Hypermedia As The Engine Of Application State

... we're using links as ways of getting around applications and saving state. But you don't have to know how to make those URLs. Each time you get a response from the server it will have with it all of the available locations that you can get to from the spot you're in and so it creates a map through your application.

Resources

Steve Klabnik Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment