REST stands for REpresentational State Transfer. The term was introduced in 2000, in Roy Thomas Fielding's dissertation Architectural Styles and the Design of Network-based Software Architectures.
The following table the expected meaning of requests in a restful API for typical use-cases:
Method | Path to a specific id, like /printers/{id} |
Path to a collection, like /printers |
---|---|---|
GET | "Please get me the data for this printer" | "Please get me the data for the entire collection of printers" |
PUT | "Please (over)write this printer with the object I have in body" | "Please (over)write this collection of printers with the object I have in body" |
POST | Don't do it. You post specific items at the collection level | "My body contains a printer object. Please add it to the collection. It'd nice if you get back to me with the resulting ID" |
DELETE | "Please delete this printer" | "Please delete the entire collection of printers" |
PATCH | "Please patch this printer object with the properties I'm sending you in body" | Not typically allowed |