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
| Method | Safe | Idempotent | Cacheable | Request body | Response body | Typical use |
|---|---|---|---|---|---|---|
| GET | Yes | Yes | Yes | No defined meaning | Yes | Read a resource |
| HEAD | Yes | Yes | Yes | No defined meaning | Never | Read headers only |
| OPTIONS | Yes | Yes | No | Allowed, rarely used | Optional | CORS preflight, discover methods |
| TRACE | Yes | Yes | No | Must not send | Yes (echo) | Loopback diagnostic |
| PUT | No | Yes | No | Yes | Optional | Create or replace at a known URL |
| DELETE | No | Yes | No | No defined meaning | Optional | Remove a resource |
| POST | No | No | Rarely (needs explicit freshness) | Yes | Yes | Create under a collection, trigger an action |
| PATCH | No | Not by default | No | Yes | Optional | Partial update |
| CONNECT | No | No | No | None | None on 2xx (tunnel starts) | Tunnel through a proxy |
What the terms mean
- Safe: the client is not asking for any state change. The server can still write logs or update a counter, because the client did not request that side effect.
- Idempotent: sending the request several times has the same intended effect on the server as sending it once. The status code can differ between attempts. Every safe method is also idempotent.
- Why idempotency matters: RFC 9110 lets clients retry idempotent requests automatically after a connection failure. A POST gets no such permission, which is why browsers warn before resubmitting a form.
- "No defined meaning": a body is not forbidden outright, but it has no standard semantics and servers or proxies may reject it. Do not build an API that depends on it.
GET
Read a resource. Responses can be cached, subject to Cache-Control and similar headers.
Use it for
- Fetching a single resource:
GET /users/42 - Listing a collection:
GET /users?limit=20 - Search and filter pages you want people to be able to bookmark and share
Avoid it for
- Any action the client is asking for, such as
GET /users/42/delete. Crawlers, link previews and browser prefetching can all follow a GET, and CSRF defenses usually exempt safe methods. - Secrets in query strings. URLs end up in server logs, browser history and
Refererheaders.
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
| Code | Meaning |
|---|---|
| 405 | Method Not Allowed. This URL exists but does not accept the method. The response must include an Allow header listing what it does accept. |
| 501 | Not Implemented. The server does not recognize the method for any resource. |
| 411 | Length Required. The server requires a Content-Length and the request has none. |
| 412 | Precondition Failed. An If-Match or similar condition was false. |
| 415 | Unsupported 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
- HTTP status codes lookup
- API tester (sends your request from your browser to the URL you enter)
- DNS records reference
- CORS, preflight, and the five-minute debugging flow
Last updated