wasAsked.

What Does REST Mean: What does REST mean? What does it mean for an API to be RESTful versus non-RESTful?

Dodge Construction Network · Senior Developer · technical

Published

Asked in 2026 · Software Engineering

Community answers

Posted by wasAsked editorial collection

REST (Representational State Transfer) is an architectural style for distributed systems, described by Roy Fielding in 2000. It is not a protocol or standard; it is a set of constraints. APIs that follow them are called RESTful. REST constraints 1. Client–server: the client and server are separated and evolve independently. 2. Stateless: each request contains everything needed to process it (authentication token, parameters); the server keeps no client session state between requests. 3. Cacheable: responses indicate whether they can be cached (Cache-Control, ETag). 4. Uniform interface: - Resources identified by URIs: /customers/42/orders. - Manipulation through representations (JSON, XML). - Self-descriptive messages: standard HTTP methods, status codes and media types. - HATEOAS: responses include links to related actions (the least commonly implemented constraint). 5. Layered system: clients cannot tell whether they talk directly to the server or through proxies, gateways or load balancers. 6. Code on demand (optional): servers can send executable code. What makes an API RESTful in practice - Resource-oriented URLs using nouns: GET /orders/42, not GET /getOrder?id=42. - HTTP methods with correct semantics: - GET reads (safe and idempotent), POST creates or triggers processing, PUT replaces (idempotent), PATCH partially updates, DELETE removes (idempotent). - Meaningful status codes: 200, 201 Created with a Location header, 204 No Content, 400, 401, 403, 404, 409, 422, 429, 500, 503. - Statelessness, so any server instance can handle any request. - Caching headers and conditional requests (ETag with If-None-Match or If-Match). - Consistent representations, pagination, filtering and versioning. Non-RESTful examples - RPC-style endpoints that put verbs in URLs: POST /api/createOrder, GET /api/deleteUser?id=5. - Using POST for everything, or returning 200 OK with { "error": true } for failures. - Server-side sessions required to process requests. - GET requests that change data (unsafe and breaks caching). - SOAP or tunnelling everything through one endpoint. Pragmatic note Most real-world "REST APIs" are HTTP APIs that follow the resource and HTTP-semantics parts without full HATEOAS — Richardson Maturity Model level 2. That is usually considered acceptable. Some operations do not map neatly to CRUD; modelling them as resources (POST /orders/42/cancellation) keeps the API consistent.

Ravindra Wadile · · 0 likes

Sign in to add your answer

Related interview topics