## This file is meant to be used with the restclient.el ## (https://github.com/pashky/restclient.el) emacs package. But, the ## syntax is fairly similiar to other REST clients e.g. that of ## VSCode.
# Get all persons GET http://localhost:3001/api/persons # Delete a persons DELETE http://localhost:3001/api/persons/3 # Add a person with a number POST http://localhost:3001/api/persons Content-Type: application/json
- {
- "name": "Alonzo Church",
- "number": "040-654321"
} # Add a person without a number (error expected) POST http://localhost:3001/api/persons Content-Type: application/json
- {
- "name": "Alonzo Church"
} # Add a person without a name (error expected) POST http://localhost:3001/api/persons Content-Type: application/json
- {
- "number": "123456789"
} # Add a person that is already in the list (error expected) POST http://localhost:3001/api/persons Content-Type: application/json
- {
- "name": "Arto Hellas", "number": "123456789"
}