The advantages of rest are: 1. State-independent, ensuring the system's horizontal expansion capabilities; 2. Establishing unified primitives for resource-related models to ensure that the system can accept diverse and standard clients.
REST itself is not an architecture, it is just an architectural style. When understanding it, you must refer to the constraints imposed by the environment in which this architectural style appears.
The purpose of REST is to "build a software system architecture that will not be outdated within ten years", so it has three characteristics:
1. State-independent - ensuring the system's horizontal expansion capability
2. Hypertext-driven, Fielding's original words are "hypertext-driven" - to ensure the system's evolutionary capabilities
3. Establish unified primitives for resource-related models, such as uri, http method definitions, etc. - to ensure the system Able to accept diverse and standard clients
From another perspective, the first one ensures the evolution of the server, the third one ensures the evolution of the client, and the second one ensures the evolution of the application itself. This is really a A very abstract solution.
The above is the detailed content of What are the advantages of rest. For more information, please follow other related articles on the PHP Chinese website!