REST stands for "Representational State Transfer" and is an architectural style or approach for developing distributed systems, particularly for web-based applications. It was originally described by Roy Fielding in his dissertation in 2000 and has since become one of the most widely used approaches for designing APIs (Application Programming Interfaces) on the web.
REST is based on several core principles:
Resources: Everything in a REST system is considered a resource, whether it's a file, a record, a service, or something else. Resources are identified using unique URLs (Uniform Resource Locators).
Statelessness: Each client request to the server should contain all the information necessary for processing that request. The server should not store information about previous requests or client states.
CRUD Operations (Create, Read, Update, Delete): REST systems often use HTTP methods to perform operations on resources. For example, creating a new resource corresponds to the HTTP "POST" method, reading a resource corresponds to the "GET" method, updating a resource corresponds to the "PUT" or "PATCH" method, and deleting a resource corresponds to the "DELETE" method.
Uniform Interface: REST defines a consistent and uniform interface that clients use to access and interact with resources. This interface should be well-defined and clear.
Client-Server Architecture: REST promotes the separation of the client and server. The client is responsible for the user interface and user interaction, while the server is responsible for storing and managing resources.
Cacheability: REST supports caching, which can improve system performance and scalability. Servers can indicate in HTTP responses whether a response can be cached and for how long it is valid.
REST is widely used and is often employed to develop web APIs that can be utilized by various applications. API endpoints are addressed using URLs, and data is often exchanged in the JSON format. It's important to note that REST does not have strict rules but rather principles and concepts that developers can interpret and implement.