Teams argue whether an API is RESTful but have no checklist — what makes an API actually REST and not just JSON over HTTP?
Per Wikipedia: “Per Fielding: REST is an architectural style with constraints — client-server, stateless, cacheable, uniform interface, layered system, code on demand (optional).”
REST is like a vending machine — every button press is a self-contained request, the machine does not remember you, and every product has a clear address.
- Model resources as nouns with URLs (/users/42)
- Use HTTP verbs for actions
- Make each request stateless with auth header
- Make responses cacheable with headers
- Use hypermedia or links for discoverability
- Resource-oriented not action-oriented
- Cacheable and layered
- Uniform interface reduces coupling
- Stateless simplifies scaling
from flask import Flask
app = Flask(__name__)
@app.get('/users/<id>')
def get_user(id): return {'id': id}- Built from: HTTP API — REST refines HTTP API design
- Related: API — REST is a style of API
- Builds into: Scalability — stateless helps scale
- Contrasts with: Full Stack — full stack may bypass strict REST
- Over-REST-ing — tunneling actions through POST /doThing breaks resource model
- Ignoring idempotency — retrying POST creates duplicates