DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk5 min

The Waiter Who Runs the Internet: A Beginner’s Guide to HTTP Methods

HTTP methods describe what a client asks a server to do with a resource. Learn the semantics and practical differences among GET, POST, PUT, PATCH, and DELETE.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

HTTP methods tell a server what a client wants to do with a resource: retrieve it, submit information for processing, replace it, modify it, or remove its association with a URI. Think of a web request as a customer asking a waiter for an action—but remember that the server decides which actions are supported for each resource.

What an HTTP method tells the server

An HTTP request combines a method with a target, such as a URL, and may include headers and a body. The method supplies standardized semantics for the request; it is not merely a label chosen by an app. The server determines whether that method is implemented and allowed for the particular resource. The IETF’s RFC 9110, HTTP Semantics, requires general-purpose servers to support GET and HEAD, while other methods are optional.

As an Amazon Associate I earn from qualifying purchases.

The restaurant analogy is useful as a first approximation: GET is like asking to see what is available, POST like placing an order for processing, PUT like specifying the complete state of an order, PATCH like requesting a particular adjustment, and DELETE like asking to cancel it. In a real API, the resource’s documented behavior—not the analogy—determines what the request does.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How the five common methods differ

Method Intended operation Safe? Idempotent? What the request body means
GET Request transfer of the selected representation of a resource. Yes Yes Not ordinarily used to carry the requested representation; consult the API’s specification.
POST Ask the target resource to process the request content according to its own semantics. No No, not generally Content for the resource to process; a common use is submitting data or creating a resource.
PUT Request creation or replacement of the target resource’s state with the supplied representation. No Yes The representation of the state the client wants the target resource to have.
PATCH Apply partial modification instructions to a resource. No Not inherently Instructions for modifying the resource, as defined by the patch format and API.
DELETE Request removal of the association between the target URI and its current functionality. No Yes Not central to the method’s meaning; any supported content is resource-specific.

These safety and idempotence classifications follow RFC 9110 and, for PATCH, RFC 5789, PATCH Method for HTTP. A server’s response can vary even when a method is idempotent: the important question is whether repeating the request has the same intended effect, not whether the response is identical.

GET: retrieve a representation

GET asks for a current selected representation of the target resource—for example, the data an API makes available at a particular URL. GET is safe: the client is not asking the server to change the resource. That does not mean the request has no incidental effects. A server may log it, update analytics, or perform other background work without changing the resource in response to the request’s intended operation.

GET is also idempotent. Repeating the same retrieval request is intended to have the same effect as making it once, although the representation or response may change if the resource changes between requests.

POST: ask a resource to process content

POST asks the target resource to process the request content according to that resource’s semantics. Submitting a form, starting a processing job, and creating a resource are common uses. POST does not mean “create” in every API, and the same POST repeated may produce additional effects, such as submitting another order. Unless an API documents special safeguards, do not assume a POST can be safely retried after an uncertain connection failure.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

PUT: create or replace the target state

PUT asks that the target resource’s state be created or replaced with the representation in the request. Its intended effect is idempotent: repeating the same PUT should not keep changing the target beyond the effect of the first request. This is different from saying every server returns the same status or response each time.

Because PUT has replacement semantics, do not assume it behaves like a partial update. How a particular resource handles omitted fields and representations is an implementation detail that its API documentation should explain.

PATCH: apply partial modifications

PATCH carries instructions for modifying part of a resource rather than asking to replace its complete state. The instruction format matters: an API might accept a document describing fields to change, but the precise format and rules are resource-specific.

Rank #3
Sale
HTTP: The Definitive Guide
  • Used Book in Good Condition

PATCH is not inherently idempotent. For example, an instruction to increment a value can have a different effect each time it is applied; an instruction to set that value to a fixed number can be idempotent. When a patch depends on a known version of a resource, a conditional request using an entity tag with If-Match can help prevent a change from being applied to an unexpected version. The API must support and document this behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DELETE: remove a resource’s URI association

DELETE asks the server to remove the association between the target URI and its current functionality. It is idempotent by intended effect: after the association is removed, repeating the request should not remove it again in a different intended way. The response may still differ between attempts.

A successful DELETE does not promise that every underlying representation or stored byte has been physically erased. A service may retain data under its own policies or perform deletion asynchronously. RFC 9110 allows success responses such as 202 Accepted, 204 No Content, or 200 OK, depending on whether processing is pending and whether the response includes information.

Rank #4

Safe and idempotent are not the same

Safe describes whether the client is asking for a state change. Idempotent describes whether repeating an identical request has the same intended effect as making it once. One classification does not imply the other: PUT and DELETE are unsafe but idempotent, while POST is generally neither. Safe methods are also idempotent.

RFC 9110 defines GET, HEAD, OPTIONS, and TRACE as safe. GET is therefore not the only safe HTTP method; it is simply the only safe method among the five covered in the table above. The broader HTTP method set also includes HEAD, OPTIONS, TRACE, and CONNECT, so these five are common examples rather than a complete list.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Using JavaScript fetch with each method

The browser’s fetch() function sends an HTTP request. These examples show the request shape, not a guarantee that a particular server supports the endpoint or content format. Replace the example URL and body with values documented by the API you are using.

Best Value

GET a resource

const response = await fetch("https://api.example.com/orders/42");
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const order = await response.json();

POST content for processing

const response = await fetch("https://api.example.com/orders", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ item: "tea", quantity: 1 })
});

PUT a replacement representation

const response = await fetch("https://api.example.com/orders/42", {
  method: "PUT",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ item: "tea", quantity: 2 })
});

PATCH partial-change instructions

const response = await fetch("https://api.example.com/orders/42", {
  method: "PATCH",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ quantity: 2 })
});

The server must define which PATCH media type and structure it accepts; the JSON shown here is only an example shape.

DELETE a resource association

const response = await fetch("https://api.example.com/orders/42", {
  method: "DELETE"
});

For any method, check the response status and follow the API’s rules for reading response content. A successful response is not always JSON, and a request can fail because of authorization, validation, unsupported methods, or other server-specific rules.

Quick Recap

SaleBestseller No. 3
HTTP: The Definitive Guide
HTTP: The Definitive Guide
Used Book in Good Condition
$26.04
SaleBestseller No. 4
HTTP Pocket Reference: Hypertext Transfer Protocol
HTTP Pocket Reference: Hypertext Transfer Protocol
Used Book in Good Condition
$6.94
SaleBestseller No. 5

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.