Chapter 2 · Practice 1 of 4
Respect what safe and idempotent mean
Why it matters
RFC 9110 gives each method properties that clients, proxies and caches rely on:
| Method | Safe | Idempotent | Typical use |
|---|---|---|---|
GET, HEAD | Yes | Yes | Read |
QUERY | Yes | Yes | Read with a query in the body |
PUT | No | Yes | Create or replace at a known URL |
DELETE | No | Yes | Remove |
POST | No | No | Create in a collection, run an action |
PATCH | No | No (unless designed to be) | Partial update |
Safe means the client does not request a state change: crawlers, prefetchers and link previews call GET freely. Idempotent means sending the request twice has the same effect as once, so clients and proxies may retry it after a dropped connection.
A GET /orders/7/cancel breaks both promises: a link preview could cancel the order.