一、REST (Representational State Transfer)
1.1 Characteristics
- The resource is located by URL.
- The system is designed from the perspective of resource, rather than from the perspective of operation as before.
- e.g, designed an api as an noun of resouce (e.g, message), rather than an verb of a operation (e.g, send message)
- The system is designed from the perspective of resource, rather than from the perspective of operation as before.
- The operation is described by HTTP verbs (e.g GET, POST).
- GET : selete the resource on the server
- POST : create the resource on the server
- PUT : update the resource on the server (the client provides the full resource after the change)
- PATCH : update the resouce on the server (the client provides the changed parts)
- DELETE
- HEAD : get metadata of the resouce
- The operation results is represented by response status code.
1.2 Representation
A representation is a sequence of bytes, plus representation metadata to describe those bytes.