Representational State Transfer
-
Statelessness is defined from the perspective of the server.
-
The constraint says that the server should not remember the state of the application.
-
As a consequence, the client should send all information necessary for execution along with each request, because the server cannot reuse information from previous requests as it didn’t memorize them.
METHOD | SCOPE | SEMANTICS |
---|---|---|
GET | collection | Retrieve all resources in a collection |
GET | resource | Retrieve a single resource |
HEAD | collection | Retrieve all resources in a collection (header only) |
HEAD | resource | Retrieve a single resource (header only) |
POST | collection | Create a new resource in a collection |
PUT | resource | Update a resource |
PATCH | resource | Update a resource |
DELETE | resource | Delete a resource |
OPTIONS | any | Return available HTTP methods and other options |