


We use cookies to improve your experience
We use essential cookies to make our site work. With your consent, we may also use non-essential cookies to improve user experience.
Definition
REST (Representational State Transfer) is an architectural style for designing networked applications. RESTful APIs use standard HTTP methods to perform CRUD operations on resources identified by URLs, returning data in formats like JSON or XML.
REST was defined by Roy Fielding in his 2000 doctoral dissertation. It is not a protocol but a set of architectural constraints: client-server separation, statelessness (each request contains all the information needed to process it), cacheability, a uniform interface, and a layered system. When an API follows these constraints, it is called RESTful.
Resources (users, products, orders) are identified by URLs like /api/users/42. The HTTP method determines the action: GET reads, POST creates, PUT/PATCH updates, DELETE removes. Responses include an HTTP status code (200 OK, 201 Created, 404 Not Found, 500 Server Error) and typically a JSON body. This predictability makes REST APIs easy to understand and consume.
REST dominates web APIs because of its simplicity and alignment with HTTP. However, it has trade-offs: over-fetching (getting more data than needed) and under-fetching (needing multiple requests to assemble a view) are common complaints. GraphQL addresses these by letting clients specify exactly which fields to return. gRPC offers better performance for internal microservice communication. Despite these alternatives, REST remains the most widely used API style on the web.