Skip to content

REST API Characteristics Explained for Beginners

REST, introduced in Roy Fielding's 2000 dissertation, is an architectural style rather than a single protocol. A RESTful design keeps the client and server independent, makes each request self-contained, and exposes resources through predictable HTTP interactions. The six constraints below explain why that model scales and evolves well.

Quick answer and the six constraints

Think of REST as a set of design rules for HTTP APIs: front end and back end evolve on their own, no request depends on earlier ones, and data is reached through resources using familiar web conventions. Those choices are what make systems simpler to grow and change over time.

Use this checklist when reviewing an API:

  • Separate client and server: presentation can be rebuilt without touching storage or business logic, and vice versa.
  • No retained session state: each call must supply everything the server needs to act, with nothing remembered from prior calls.
  • Explicit reuse permission: a response may only be stored and replayed when the server clearly allows it.
  • Consistent interface: resources follow shared conventions for addresses, methods and media types.
  • Intermediary layers allowed: gateways, proxies and load balancers can be inserted without altering what clients observe.
  • Optional code delivery: a server may send executable code to extend a client, though modern APIs seldom do this.

A simple GET request illustrates the pattern. The client asks for one user resource, states that it accepts JSON, checks the response status, and parses the body. See protected modules code0001 for the request and code0002 for the example JSON response. The result is a short, structured payload rather than a custom procedure call.

Client-server separation and resources

The client handles presentation and interaction: screens, navigation, forms and rendering. The server owns storage, validation and business rules. Neither side needs to know the other's internal implementation.

That boundary has practical consequences. A front end can be redesigned without changing server logic, and a database or server implementation can change without rewriting clients, as long as the API contract remains stable. Teams can also work in parallel, and the server side can scale horizontally while existing clients continue to work.

Protected module code0003 maps the two sides. Protected modules code0004 and code0005 show a minimal server exposing a user resource and a client requesting it as JSON.

A resource is the thing being addressed — a user, order, product or task. URLs name resources, while HTTP methods describe the action. For example, a collection address lists users and an address with an identifier selects one user. This noun-and-verb pattern is more predictable than inventing procedure-style endpoints for every operation.

Statelessness: each request carries its own context

In a stateless design, the server does not retain session memory between calls. Request A and request B are treated as unrelated unless each one supplies the identity and parameters it needs.

Authentication therefore travels with the request, commonly as a token in the Authorization header. The server validates that token on each call and decides whether the action is allowed. Protected module code0006 shows that pattern.

The trade-off is clear: requests may be slightly larger because context is repeated, but any server in a cluster can handle any request. That makes horizontal scaling simpler and avoids sticky-session complexity. Some real-world APIs still use cookie sessions, but that is a departure from strict stateless REST.

Cacheability and performance

REST does not make every response cacheable automatically. The server must say so, usually through Cache-Control headers set in server code or in a reverse proxy or API gateway. Without those signals, the safe assumption is not to cache.

A short lifetime can already help during traffic spikes. For stable or frequently requested data, even a few seconds of micro-caching can prevent repeated identical work. Protected module code0007 shows a 60-second public cache header, code0010 shows a 5-second variant, and code0011 shows a client requesting a trending resource that may be served from cache.

For longer-lived data, ETags and Last-Modified support conditional requests. If nothing has changed, the server can return 304 Not Modified so the client reuses its copy. Protected module code0008 shows a server setting a cache header, and code0009 shows the conditional-request headers. Cacheability is therefore a deliberate server decision, not a client guess.

Layered system, code-on-demand and uniform interface

A layered system allows load balancers, caching proxies, API gateways and reverse proxies between client and server. The client does not need to know how many layers exist; it sends a request and the layers route it. Layers can add scaling, security, rate limiting or caching without changing the API itself.

Code-on-demand is the only optional constraint. It allows a server to send executable code, usually JavaScript, to extend client behaviour. Most modern APIs do not use it, so treat it as an available option rather than a core practice.

The uniform interface is a bundle of four ideas: resources are identified by stable URIs, responses represent those resources, messages are self-descriptive, and hypermedia can expose possible next actions. In practice, consistent HTTP methods do most of the work: GET retrieves, POST creates, PUT replaces, DELETE removes. PATCH is common for partial updates but was not part of the original Fielding constraints.

Use the method table as a design check: list resources with GET on a collection, create with POST on the same collection, read one item with GET on its identifier, replace it with PUT, partially update it with PATCH where supported, and remove it with DELETE. Protected module code0012 shows a hypermedia-style response with links to related resources, and code0013 shows a self-descriptive response whose headers state the media type and cache lifetime. HATEOAS is part of the original model, although many modern APIs omit it; clients that follow server-provided links can adapt when routes change.

Conclusion

In short: keep client and server separate, retain no session state between calls, let the server decide what may be reused, allow intermediaries in the path, apply one consistent interface, and treat code delivery as optional. You do not need to memorise the list to use REST, but understanding it helps you design clients, debug requests and judge whether an API is genuinely RESTful or merely using HTTP.

Common REST actions on a user resource
HTTP methodEndpointActionDescription
GET/usersRead (list)Fetch a list of all users
POST/usersCreateCreate a new user
GET/users/1Read (single)Fetch user with ID 1
PUT/users/1Update / replaceReplace the entire user record with new data
PATCH/users/1Partial update (optional but common, not strictly part of the original REST)Update only specific fields of user 1
DELETE/users/1DeleteRemove user with ID 1

PATCH is widely used but is not part of the original Fielding constraints; the table marks it as optional.

Frequently asked questions

What is a characteristic of the REST API?

A REST API follows architectural constraints: client-server separation, stateless requests, cacheable responses, a layered system, a uniform interface, and optional code-on-demand.

Why is statelessness important in REST APIs?

Statelessness keeps the server simple. Each request carries its own context, so scaling is easier and session storage is not required.

Do all REST APIs follow cacheability rules?

No. REST allows caching, but each API decides which responses can be cached. Many modern APIs use short-lived caching to improve performance.

What makes REST different from SOAP?

SOAP is a strict protocol with rigid message formats. REST is an architectural style that uses simple HTTP methods and flexible data formats, making it easier to learn and work with.

How is REST different from GraphQL or gRPC?

REST works around resources and standard HTTP methods like GET, POST, PUT, and DELETE. GraphQL lets the client ask for exactly the data it wants through a single flexible query endpoint. gRPC is a high-performance RPC system that uses protobufs and is common in internal microservices. For beginners, REST is the simplest place to start.

{
  "id": 1,
  "name": "Leanne Graham",
  "username": "Bret",
  "email": "[email protected]"
}
{
  "id": 12,
  "name": "Mira",
  "email": "[email protected]",
  "_links": {
    "self": { "href": "/users/12" },
    "orders": { "href": "/users/12/orders" },
    "settings": { "href": "/users/12/settings" }
  }
}