Skip to content

Chapter 1 of 7

Foundations of REST

REST, or Representational State Transfer, is an architectural style for designing scalable web APIs that leverages the standard HTTP protocol. At its heart, a REST API exposes resources—any named, addressable entity such as a user, an order, or a document—through URIs, and represents those resources in formats like JSON. This approach turns the web's existing infrastructure into an API platform rather than inventing a new protocol, which is one reason it has become the dominant model for public and private web services.

The architectural style is defined by a set of constraints that, taken together, give REST its scalability and loose coupling. The client-server separation keeps presentation concerns on the client and data storage on the server, allowing each side to evolve independently. Statelessness requires that every request carry all the information the server needs to fulfill it; the server stores no session state between requests, which simplifies scaling because any node can handle any request. Cacheability, the layered system constraint (which permits intermediaries like load balancers and caches without the client's knowledge), the uniform interface, and the optional code-on-demand constraint round out the foundation. Together these principles push APIs toward predictability, scalability, and evolvability.

The uniform interface constraint deserves special attention because it shapes nearly every other design decision. It standardizes four things: how resources are identified with URIs, how they are manipulated through HTTP methods, the format of messages (typically JSON), and how clients discover actions through hypermedia links in the HATEOAS pattern. Because every conforming REST API uses the same vocabulary of methods and status codes, clients and tooling can be reused across services, which is a major reason the style has become so dominant.

All chapters
  1. 1Foundations of REST
  2. 2HTTP Methods and Their Semantics
  3. 3URI Design and Resource Modeling
  4. 4Status Codes and Error Handling
  5. 5Data Formats, Content Negotiation, and Hypermedia
  6. 6Performance Patterns
  7. 7Security, Authentication, and Cross-Cutting Concerns

Drill it

Reading is not remembering. These come from the Rest API Design deck:

Q

What does REST stand for?

REST stands for Representational State Transfer, an architectural style for designing scalable web APIs using standard HTTP protocols.

Q

What is a resource in REST API design?

A resource is any entity or information that can be named and addressed via a URI, such as a user, order, or document, represented in a format like JSON.

Q

What are the core principles of REST?

REST follows principles like client-server separation, statelessness, cacheability, uniform interface, layered system, and optionally code-on-demand.

Q

What does statelessness mean in REST?

Statelessness requires that each request from a client contains all necessary information for the server to process it, without relying on server-stored session...