Know each verb’s contract before you wire it up
Every HTTP method carries a semantic contract: whether it is safe (read-only), idempotent (repeatable without extra effect), cacheable, and whether it has a request body. Getting these right decides whether clients may retry, whether proxies may prefetch, and whether responses can be cached. This matrix lists all standard methods with each property and a searchable lookup.
How it works
The properties are defined by the HTTP specification, not by your framework:
GET safe idempotent cacheable
POST — — only with explicit freshness
PUT — idempotent —
PATCH — — —
DELETE — idempotent —
- Safe ⇒ the method must not modify resources. Implies it is also idempotent.
- Idempotent ⇒ N identical requests leave the server in the same state as one.
- Cacheable ⇒ the response may be stored and reused per cache directives.
A retry after a network timeout is safe only for idempotent methods; otherwise use an idempotency key so the server can de-duplicate.
Tips and notes
- All safe methods are idempotent, but not all idempotent methods are safe.
PUTreplaces the whole resource;PATCHapplies a partial, possibly non-idempotent change.- Make
POSTretry-safe with anIdempotency-Keyheader de-duplicated on the server. OPTIONSpowers CORS preflight;HEADreturns headers only with no body.TRACEandCONNECTare rarely used and often disabled for security.