REST (Representational State Transfer) is an architectural style for designing networked applications. REST APIs allow clients and servers to communicate using standard HTTP methods in a simple, scalable, and stateless manner.
In REST, everything is treated as a resource. Each resource is accessed using a unique URI and manipulated using standard HTTP verbs. The server does not store any client context between requests.
// Example RESTful endpoint definitions
GET /api/users
POST /api/users
GET /api/users/1
PUT /api/users/1
DELETE /api/users/1
A client sends an HTTP request to a specific URI. The server processes the request and returns a response with a status code and data (usually JSON).
Click the buttons below to simulate REST requests.
// Simple fetch request demonstrating stateless communication
fetch("/api/users")
.then(response => response.json())
.then(data => console.log(data));