Web & Dev

HTTP Request Methods

RFC-standard HTTP methods, their semantics, idempotency, and when to use each.

Methods

MethodSafeIdempotentBody?Purpose
GETYesYesNoRetrieve a representation of the resource.
HEADYesYesNoLike GET but returns only headers.
OPTIONSYesYesNoDescribe communication options (CORS preflight).
TRACEYesYesNoEcho back what the server received (debugging).
POSTNoNoYesCreate a new resource or submit data.
PUTNoYesYesReplace the resource entirely.
PATCHNoNoYesApply partial modifications.
DELETENoYesOptRemove the resource.
CONNECTNoNoNoEstablish a tunnel (HTTPS through a proxy).

Notes

  • Safe: does not modify server state.
  • Idempotent: same request N times = same state as once.
  • PATCH is technically not idempotent by the RFC, though many APIs implement it idempotently.
Was this article helpful?