Skip to content

Instantly share code, notes, and snippets.

@dwayne
Last active November 5, 2022 23:05
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dwayne/9771508 to your computer and use it in GitHub Desktop.
Save dwayne/9771508 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