HTTP Method Reference
Your workspaceProcessed on your device
Check recorded request lines
9 matching methods
GET · Retrieve the current representation of a resource.
- Safe
- Yes
- Idempotent
- Yes
- Caching
- Cacheable subject to the applicable cache rules.
- Request content
- Content has no generally defined semantics.
- Response content
- Usually a representation. A 304 response carries no content.
- Common status codes
- 200 for a representation, 206 for an accepted range, or 304 when the conditional request can reuse a cached representation.
GET /articles/42 HTTP/1.1
Host: example.com
Accept: application/jsonHEAD · Ask for the headers that describe a GET response.
- Safe
- Yes
- Idempotent
- Yes
- Caching
- Cacheable and may update metadata on cached GET responses.
- Request content
- Content has no generally defined semantics.
- Response content
- No response content.
- Common status codes
- 200 for an available resource or 404 when the resource is unavailable.
HEAD /downloads/report.pdf HTTP/1.1
Host: example.comPOST · Submit content for processing according to the target resource's rules.
- Safe
- No
- Idempotent
- No
- Caching
- Limited to responses with explicit freshness and a Content-Location matching the target URI. This can supply a later GET or HEAD.
- Request content
- Content carries the data the resource processes.
- Response content
- Can carry the operation's result or a reference to what was created.
- Common status codes
- 201 when a resource is created, 202 for accepted pending processing, or 422 when the content instructions cannot be processed.
POST /orders HTTP/1.1
Host: example.com
Content-Type: application/json
Content-Length: 15
{"quantity": 2}PUT · Set the state of the chosen target using the supplied representation.
- Safe
- No
- Idempotent
- Yes
- Caching
- A PUT response is not cacheable.
- Request content
- Content represents the intended state of the target.
- Response content
- 200 may include a result. 204 carries no content.
- Common status codes
- 201 when creating a previously absent target, or 200 or 204 when modifying one.
PUT /profiles/42 HTTP/1.1
Host: example.com
Content-Type: application/json
Content-Length: 20
{"displayName":"Jo"}PATCH · Apply a set of changes described by a patch document.
- Safe
- No
- Idempotent
- No
- Caching
- Limited to explicit freshness and a Content-Location matching the request URI. A stored response can supply a later GET or HEAD.
- Request content
- The patch document's media type defines how to apply its instructions.
- Response content
- The server can return the updated representation or complete with 204.
- Common status codes
- 200 or 204 after applying the patch, 412 when an If-Match condition fails, or 415 for an unsupported patch format.
PATCH /profiles/42 HTTP/1.1
Host: example.com
Content-Type: application/merge-patch+json
If-Match: "profile-7"
Content-Length: 20
{"displayName":"Jo"}DELETE · Remove the association between the target URI and its current functionality.
- Safe
- No
- Idempotent
- Yes
- Caching
- A DELETE response is not cacheable.
- Request content
- Content has no generally defined semantics.
- Response content
- A 200 response can explain the result. A 204 response carries no content.
- Common status codes
- 202 for an accepted pending deletion, 204 after completion, or 200 with a representation describing the result.
DELETE /drafts/42 HTTP/1.1
Host: example.comOPTIONS · Ask about communication options for a target resource or server.
- Safe
- Yes
- Idempotent
- Yes
- Caching
- An OPTIONS response is not cacheable.
- Request content
- Send Content-Type if providing content. HTTP defines no general use for it.
- Response content
- Can contain headers such as Allow that advertise available options.
- Common status codes
- A successful response can disclose supported methods. For a browser's CORS preflight, inspect the Access-Control response fields as well.
OPTIONS /profiles/42 HTTP/1.1
Host: example.comCONNECT · Ask an intermediary to establish a tunnel to a host and port.
- Safe
- No
- Idempotent
- No
- Caching
- A CONNECT response is not cacheable.
- Request content
- An HTTP/1.1 CONNECT request has no content and uses a host and port as its target.
- Response content
- A successful response switches the connection to tunnel data.
- Common status codes
- A 2xx response establishes the tunnel. A proxy may respond with 407 to request authentication.
CONNECT example.com:443 HTTP/1.1
Host: example.com:443TRACE · Ask the receiving HTTP server to reflect a diagnostic request.
- Safe
- Yes
- Idempotent
- Yes
- Caching
- A TRACE response is not cacheable.
- Request content
- Requires an empty body. Keep credentials and cookies out of diagnostic examples.
- Response content
- A successful response can contain the received message with sensitive fields removed.
- Common status codes
- Uses 200 for a diagnostic response. Individual servers may disable the method.
TRACE / HTTP/1.1
Host: example.com
Max-Forwards: 0