REST (Representational State Transfer) is an architectural style for designing networked applications that uses HTTP as the transport protocol and treats everything as a resource accessible via a unique URI. REST APIs enable stateless client-server communication through standard HTTP methods, making them the dominant approach for building web services. The key principle to remember: REST APIs model your application domain as resources, not remote procedures — the URI identifies what resource you're working with, and the HTTP method tells the server what action to take on that resource.
What This Cheat Sheet Covers
This topic spans 28 focused tables and 194 indexed concepts, 165 flashcards, 9 practice tests with 257 questions. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Core Principles and Constraints
These are the architectural constraints Roy Fielding set out in his 2000 dissertation, and they are what separate genuinely RESTful design from plain "HTTP with JSON." Statelessness shapes the most decisions, since keeping session state on the client is what lets any server in a pool answer any request. Six of the seven are required; code-on-demand is the one you are free to skip.
| Principle | Example | Description | |
|---|---|---|---|
Each request includes Authorization: Bearer <token>to authenticate independently | • Every request must contain all information needed to process it • server keeps no client session state between requests, though a database is still fine | ||
Client handles UI; server handles data storage and business logic separately | • Decouples user interface concerns from data storage, so both evolve independently • a boundary of concerns, not of machines | ||
Resources identified by URIs; manipulated via standard HTTP methods (GET, POST, etc.) | • Simplifies and decouples the architecture • four sub-constraints: resource identification, manipulation via representations, self-descriptive messages, hypermedia • format-agnostic: JSON is convention, not a rule | ||
/users/123 identifies a user resource; the JSON returned represents it | • A URI identifies a resource, meaning a concept, not a database row • what transfers is a representation, never the resource itself | ||
Cache-Control: max-age=3600 on GET response | • Responses must label themselves cacheable or not, implicitly or explicitly • declaring a response non-cacheable satisfies the constraint | ||
Client → CDN → Load Balancer → Backend Server | • Client cannot tell whether it reached the origin server or an intermediary • lets you insert caches, gateways, and load balancers without changing clients | ||
Server returns JavaScript the browser downloads and runs | • Server may extend client behavior by sending executable code such as scripts or applets • the only optional constraint, since downloaded code reduces visibility |