Skip to content

Instantly share code, notes, and snippets.

View scwebd's full-sized avatar

Sarah Cullen scwebd

  • Denver, CO
View GitHub Profile
Best practices for REST include:
- Put your REST API on it’s own URL (e.g. ‘/api/todos’ or ‘/api/purchases’)
- A POST that creates an item should return the ID of the item it created.
- PUT and DELETE should specify the ID of the item they're intended to affect in the URL (e.g. '/todos/123').

- If the ID for the item specified in a PUT or DELETE couldn't be found, return a 404.

- If an error occurs in the server, return an error code (e.g. 500).