# What is REST? — REST API Design

Source: https://www.geekswithgeeks.com/en/restapi/api-rest-intro

> The architectural style behind most web APIs, and the ideas that define it.

## REpresentational State Transfer

REST isn't a protocol or a spec — it's an **architectural style** for building networked APIs, usually over HTTP. A server exposes **resources** (users, orders, products), and clients manipulate them through a small, uniform set of operations.

## The guiding principles

**Client-server**: UI and storage evolve separately. **Stateless**: every request carries all context it needs. **Cacheable**: responses declare if they can be cached. **Uniform interface**: resources are addressed and manipulated in a consistent way. **Layered system**: clients can't tell if they're talking to the origin or a proxy.

## A restaurant menu

Think of resources as menu items and HTTP methods as ways you can act on them: you *order* (POST) a new dish, *view* (GET) what you ordered, *modify* (PUT/PATCH) the order, or *cancel* (DELETE) it. The menu (URIs) stays the same; what changes is the verb you use.

## Most APIs are "RESTish"

Very few real-world APIs satisfy every REST constraint strictly (few implement HATEOAS, for instance). Treat REST as a set of good defaults, not a checklist to pass.
