
REST defines guidelines that ensure APIs remain robust and user-friendly. These constraints support the creation of APIs that are efficient and straightforward to maintain.
-
Client-Server Architecture
The system is divided into clients, servers, and resources. Interactions occur via clearly defined HTTP requests between these components. -
Stateless Communication
Each client request must be independent. No information about the client’s session is stored on the server between requests. This ensures every interaction is treated as a complete, standalone transaction. -
Uniform Interface
A consistent interface simplifies communication between components. Resources are easily identifiable, and clients manipulate them using the information provided in the API response. -
Self-Descriptive Messages
API responses include all necessary details—such as HTTP status codes and headers—enabling the client to understand and process the information without additional context. -
Optional: Code-on-Demand
Although not a requirement, servers can deliver executable code to clients when beneficial, thereby extending functionality on demand.
