HTTP method

The verb at the start of a web request that says what the client wants, such as GET to read or POST to create.

In more detail

Each method carries promises: GET and HEAD are safe, PUT and DELETE are idempotent, and POST promises neither. POST to a collection creates, GET reads, PUT replaces the whole resource, PATCH changes only the fields you send, and DELETE removes. Caches, proxies and retry logic act on these promises, so choosing the wrong method creates bugs far away from your code.

Examples

POST /tasks  create
PATCH /tasks/1  update some fields
PUT /tasks/1  replace the whole thing
http.MethodGet
@GetMapping maps GET requests; @PostMapping maps POST requests
GET asks for a representation without changing anything, POST submits data, PUT replaces, PATCH changes part of something and DELETE removes it. The method expresses the request's intent.
A Route Handler exports functions named after methods: export async function GET() and export async function POST().
Span names such as GET /checkout and POST payments start with the HTTP method.
A plain HTML form submits with POST; a React 19 form action intercepts the submission on the client.
In this course: a contract names each endpoint by its method and path, such as GET /profile.

Related terms

Taught in

References

Certification courses