HTTP Methods Reference

What each method promises, what caches and clients assume, and which status codes usually go with it.

By BoltQuickTools team · Updated November 8, 2026

RFC 9110 defines eight methods: GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS and TRACE. PATCH comes from a separate document, RFC 5789. Method names are case-sensitive and uppercase by convention. Choosing the right one matters because caches, browsers, proxies and retry logic all act on what the method promises.

Quick reference

MethodSafeIdempotentCacheableRequest bodyResponse bodyTypical use
GETYesYesYesNo defined meaningYesRead a resource
HEADYesYesYesNo defined meaningNeverRead headers only
OPTIONSYesYesNoAllowed, rarely usedOptionalCORS preflight, discover methods
TRACEYesYesNoMust not sendYes (echo)Loopback diagnostic
PUTNoYesNoYesOptionalCreate or replace at a known URL
DELETENoYesNoNo defined meaningOptionalRemove a resource
POSTNoNoRarely (needs explicit freshness)YesYesCreate under a collection, trigger an action
PATCHNoNot by defaultNoYesOptionalPartial update
CONNECTNoNoNoNoneNone on 2xx (tunnel starts)Tunnel through a proxy

What the terms mean

GET

Read a resource. Responses can be cached, subject to Cache-Control and similar headers.

Use it for

Avoid it for

GET /api/users/42 HTTP/1.1
Host: example.com
Accept: application/json
If-None-Match: "v7"

HTTP/1.1 304 Not Modified
ETag: "v7"

Common responses: 200, 206 for range requests, 304 for conditional requests, 404.

POST

Hand data to the server to process. The most common uses are creating an item in a collection and starting an action that does not fit the other methods.

Because POST is not idempotent, a client that retries after a timeout may create a duplicate. A widely used fix is an Idempotency-Key request header: the client sends a unique value, and the server stores the result under that key and returns it for repeats. It is a convention with an IETF draft behind it and needs server support, so sending the header alone does nothing.

POST /api/users HTTP/1.1
Host: example.com
Idempotency-Key: 8d3e2c2a-...
Content-Type: application/json

{"name": "Alice"}

HTTP/1.1 201 Created
Location: /api/users/42

Common responses: 201 with Location, 200, 202 for queued work, 400, 409, 422.

PUT vs PATCH

PUT sends the new full state of the resource. PATCH sends a description of changes.

PUT

The body becomes the state at that URL, so fields left out are normally cleared or reset. The client must know the URL, and PUT can create the resource there (201) as well as replace it (200 or 204).

PUT /api/users/42 HTTP/1.1
Content-Type: application/json

{"name": "Alice", "email": "[email protected]"}

PATCH with JSON Merge Patch (RFC 7396)

Send only the fields to change. A null removes a field, and arrays are replaced whole, so this format cannot set a field to null or edit one array element.

PATCH /api/users/42 HTTP/1.1
Content-Type: application/merge-patch+json

{"email": "[email protected]", "nickname": null}

PATCH with JSON Patch (RFC 6902)

An array of operations (add, remove, replace, move, copy, test) applied in order, all or nothing. A leading test works as a precondition.

PATCH /api/users/42 HTTP/1.1
Content-Type: application/json-patch+json

[{"op":"test","path":"/version","value":7},
 {"op":"replace","path":"/email","value":"[email protected]"}]

Lost updates

Two clients that read and then write will overwrite each other. Return an ETag on read and require If-Match on write. The server answers 412 Precondition Failed if the version changed.

DELETE

Remove the resource at a URL. It is idempotent because the intended end state is the same after one call or five, even though the first call might return 204 and the next 404. Treat a 404 on a retried DELETE as success.

Common responses: 204 with no body, 200 with a status body, 202 if deletion is queued. Avoid request bodies, because some servers and proxies reject or strip them. Send filters for bulk deletes through a POST action instead.

HEAD

Same response headers as GET, with no body. Useful for existence checks and for reading Last-Modified or Accept-Ranges before a download. Content-Length is often present, but servers may leave it out.

OPTIONS

Asks what the server supports for a URL, usually answered with an Allow header. In practice its main job is the CORS preflight: before a cross-origin request that is not a CORS "simple" request, the browser sends OPTIONS to ask permission. Preflights carry no cookies, so authentication middleware must let them through. See the CORS debugging post for a diagnostic flow.

OPTIONS /api/users/42 HTTP/1.1
Origin: https://app.example.com
Access-Control-Request-Method: PATCH
Access-Control-Request-Headers: content-type

HTTP/1.1 204 No Content
Access-Control-Allow-Origin: https://app.example.com
Access-Control-Allow-Methods: GET, PATCH
Access-Control-Allow-Headers: content-type
Access-Control-Max-Age: 600

TRACE and CONNECT

TRACE echoes the received request so you can see what intermediaries changed. It is commonly disabled because of cross-site tracing (XST), and browsers refuse to send it from fetch() or XMLHttpRequest.

CONNECT asks a proxy to open a tunnel, most often for HTTPS. The client sends CONNECT example.com:443 HTTP/1.1, the proxy connects and replies 200, and from then on it relays bytes without reading them. Browser scripts cannot use it either.

Status codes for method problems

CodeMeaning
405Method Not Allowed. This URL exists but does not accept the method. The response must include an Allow header listing what it does accept.
501Not Implemented. The server does not recognize the method for any resource.
411Length Required. The server requires a Content-Length and the request has none.
412Precondition Failed. An If-Match or similar condition was false.
415Unsupported Media Type. The server cannot handle this Content-Type. A PATCH sent as plain application/json is a common cause.

Redirects can change the method

After a 301 or 302, browsers and many clients turn a POST into a GET and drop the body. A 303 always means "GET this next". Use 307 or 308 when the method and body must be preserved.

Related

Last updated