CRUD HTTP Methods
Most database operations can be described using the acronym CRUD. You Create data, you Read data, you Update and finally you Delete data.
These operations describe the lifecycle of data in a database. RESTful web services (almost) map CRUD operations using the HTTP verbs GET, PUT, POST, PATCH and DELETE.i
The mapping between CRUD operations and HTTP verbs isn't perfect. Read and Delete are easy, these operations are mapped by GET and DELETE, but Create and Update is more problematic.
A common mapping is:
CRUD operation | HTTP Verb |
---|---|
Create | PUT with a new URI |
POST to a base URI returning a newly created URI | |
Read | GET |
Update | PUT with an existing URI |
PATCH | |
Delete | DELETE |
The exact behavior varies with the exact RESTful service.