As we've described previously, REST relies on the idea of interacting with resources. The HTTP protocol has a number of what are called verbs, or methods, used to interact with remote resources. For the purpose of REST, we use POST, GET, PATCH and DELETE which map to the basic CRUD operations of Create, Read, Update and Delete. Each of these verbs has specific meanings and properties:
|
Verb |
Description |
Properties |
|
GET |
Reads a resource |
Safe, idempotent and cacheable |
|
POST |
Creates a resource or trigger a data-handling process |
Not safe, idempotent or cacheable |
|
PATCH |
Updates specified fields in a resource |
Idempotent, but not safe or cacheable |
|
DELETE |
Deletes a resource |
Idempotent, but not safe or cacheable |
Safe operations are ones that are "read-only": idempotent operations are ones where the effects on the system from performing multiple identical requests are the same as performing only a single one.