Skip to content

HTTP method

An HTTP method, also called an HTTP verb, is a keyword at the start of an HTTP request that tells a server what action a client wants to perform on the resource named by a URL. Each method carries agreed-upon semantics, so a request line like GET /articles/42 names both the operation and its target.

The protocol defines a small set of standardized methods, which can be extended through an IANA registry, and a handful of them account for almost all traffic:

  • GET: Retrieves a representation of a resource without changing it.
  • POST: Submits data to a resource, often creating a new record or triggering server-side processing.
  • PUT: Replaces the target resource entirely with the supplied representation.
  • PATCH: Applies a partial update to an existing resource.
  • DELETE: Removes the target resource.
  • HEAD: Requests only the headers that a GET would return, without the body.
  • OPTIONS: Asks which methods and features the resource supports.

Two cross-cutting properties classify these methods. A method is safe when it only reads data and leaves server state unchanged, as GET, HEAD, and OPTIONS do.

A method is idempotent when sending an identical request several times has the same effect on the server as sending it once. GET, PUT, and DELETE are idempotent, whereas POST usually is not, since each call tends to create another record. These guarantees let caches, proxies, and clients retry or reuse requests without corrupting data, and the grid below sorts each method by both properties:

GET, HEAD, and OPTIONS are safe and idempotent, PUT and DELETE idempotent only, POST and PATCH neither.
Safe and Idempotent by Method

REST-style APIs map these methods onto create, read, update, and delete operations, and Python reaches them through its http and urllib packages.

Python's urllib.request for HTTP Requests

Tutorial

Python's urllib.request for HTTP Requests

In this tutorial, you'll be making HTTP requests with Python's built-in urllib.request. You'll try out examples and review common errors encountered, all while learning more about HTTP requests and Python in general.

intermediate api web-dev web-scraping

For additional information on related topics, take a look at the following resources:

Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials.


By Martin Breuss • Updated Nov. 6, 2026