HTTP Methods Table

–click a method name to copy it
MethodTypical useKey trait
GETFetch a resourcesafe, idempotent, cacheable
HEADGET without the bodysafe, idempotent, cacheable
OPTIONSAsk what the endpoint allowssafe, drives CORS preflight
POSTCreate; submit dataneither safe nor idempotent - doubles create doubles orders
PUTReplace a resource wholesaleidempotent - same request, same end state
PATCHModify part of a resourcenot guaranteed idempotent - depends on the patch
DELETERemove a resourceidempotent - deleting twice changes nothing more
CONNECTTunnel through a proxythe method HTTPS proxies speak
TRACELoop the request backoften disabled - leaks cookies and auth headers
Semantics are verbatim from MDN's HTTP request methods reference. The two properties that decide everything: safe methods (GET, HEAD, OPTIONS) never change server state, and idempotent methods (GET, HEAD, OPTIONS, PUT, DELETE) can be replayed without side effects stacking - which is why retry logic wraps PUT but never POST. CORS preflight is an automatic OPTIONS with Access-Control-Request headers, invisible in devtools panels people usually watch. Bottom line: the POST-vs-PUT argument is not taste - if the client controls the resource ID it is PUT, if the server issues the ID it is POST; get that backwards and retry logic double-charges customers. Status-side partners: HTTP status codes table, addresses URL parser, payload types MIME types table.

Nine HTTP request methods cover virtually every API call ever made - and their contracts (safe? idempotent? cacheable?) decide retry logic, caching layers and CORS preflights. This table carries all nine verbatim from MDN with the property flags that make the differences mechanical.

The arguments end here: the client chooses the resource ID means PUT, the server issues it means POST; retry anything idempotent, never blind-retry a POST.

How to use

  1. Filter by property - safe, idempotent, cacheable - to see which methods survive retries and proxies.
  2. Click a method name to copy it into a doc, an annotation or an API spec.
  3. Check the CONNECT and TRACE rows for the two methods you will rarely implement but should recognize in logs.

Frequently asked questions

Why is PUT idempotent but POST not?

PUT replaces the resource at a URL you choose - repeating it lands the same state. POST tells the server to do something, and doing it twice usually means two records or two charged cards. That asymmetry is why payment APIs accept POST but wrap it with client-side idempotency keys.

What makes a method safe?

Safe methods (GET, HEAD, OPTIONS) never change server state - they are read-only, which is why crawlers may follow them freely and proxies may cache them. PUT and DELETE change state, so they are unsafe even though they are idempotent; the two properties are independent.

What is CORS preflight?

Before certain cross-origin requests, the browser automatically sends an OPTIONS request asking whether the real request is allowed - carrying Access-Control-Request-Method headers. If the server answers wrong, the real request never fires; debugging CORS means debugging an OPTIONS you never wrote.

Is PATCH idempotent like PUT?

Not guaranteed - PATCH applies an instruction, and instructions can stack: {"op":"increment"} changes the resource twice when sent twice. A PATCH that sets absolute values behaves idempotently, but the spec leaves it to the patch format, so retry logic treats PATCH as carefully as POST.

Related tools