HTTP request = method (verb) + status (verdict) + headers (metadata). Senior skill — contracts: safe, idempotent, cacheable, retriable.
Разбор
Stateless protocol: server no memory; who you are, format, cache freshness — all in headers. Envelope: method = instruction, headers = routing notes, body = cargo.
Three properties in method contract:
| Property | Meaning | Methods |
|---|
| Safe | Read-only; no state change | GET, HEAD, OPTIONS |
| Idempotent | N calls == 1 effect | GET, HEAD, PUT, DELETE, OPTIONS |
| Cacheable | May store & replay | GET, HEAD (+ explicit POST) |
POST — not safe, not idempotent → double checkout charges twice → idempotency keys.
Итог
Methods carry semantics the whole ecosystem assumes; break GET safety → phantom writes in CDN.