Rest is the presentation of state passing, which is not a standard design style. The rest architecture style has the following 6 constraints:
1. Client-Server (client-server): Communication can only be initiated unilaterally by the client and is represented as a request-response form.
2. Stateless: The session state of the communication should all be maintained by the client.
3. Caching: Response content can be cached somewhere in the communication chain to improve network efficiency.
4. Unified interface: The components of the communication chain communicate with each other through a unified interface to improve the visibility of the interaction.
5. Tiered systems: Decompose the schema into tiers of layers by restricting the behavior of the components (that is, each component can only "see" and interact with the neighboring layer).
6. On-Demand code: Support to extend the functionality of the client by downloading and executing some code.
The rest software architecture uses the curd principle, which requires only 4 behaviors for a resource: Create, get (read), UPDATE, Destroy (delete), and the four request methods for the corresponding HTTP protocol are: Post,get,put,delete
REST-style API