REST stands for Representational State Transfer.
It’s a popular language-independent architectural style, widely-used to create web APIs.
REST allows web services to communicate with each other easily. It’s based on an HTTP request-response model.
It was first introduced by Roy Fielding in 2000 in his PhD dissertation.
Web services using REST are called RESTful web services.
When a RESTful API is called, the server will specify (represent) the state of the requested resource to the client.
The representation of the state aka response is provided in JSON, XML, or HTML format.
A web service must meet six architectural constraints to be considered as RESTFUL.
- Client-server architecture
- Uniform interface
- Code on demand (optional)
Stateless is very important property of REST. It means that server and client do not need to track each other’s state. Also, when a client sends a request to the server, it will contain everything to make the server able to respond. This data can be part of the URL, headers, or query-string.
REST uses standard HTTP requests such as GET, POST, PUT, DELETE, HEAD, and more.
It’s popular for its extensibility, reliability, ease of use, and faster performance.