jonm.dev

The Art of Writing Software



REST-Based service design

Series [ REST-based Service Design ] Tags [ REST API ]

Just wanted to walk through a quick REST-style API design exercise. Let’s suppose I want a service that lets folks maintain a list of favorite foods. Just as a quick strawman design, let’s walk through some URIs and supported operations:

So, questions for the audience:

  1. Does this look reasonable?
  2. Does the use of PUT look right, or would you use POST here?
  3. How about the use of DELETE to set the full list to the empty list? Does it make sense to DELETE a URI and then be able to GET it and have something be there?