= HTTP request method
{c}
An <HTTP request method> identifies the operation requested for an <HTTP request>'s target. The target and method have separate roles: the same resource can be read, replaced or processed according to the chosen method and its defined semantics. Method tokens are case-sensitive.<HTTP Semantics>[§9.1, method overview]{ref}
For example, an invented `/color` resource uses `GET` to retrieve its current color and `PUT` to replace that color with the supplied value. One `PUT` storing `blue` and two identical such operations leave the same intended color. A different `/log` resource is stipulated to append each `POST` value: two appends of `x` then produce two entries. The append behavior belongs to this example application; it is not a universal definition of every `POST`.
<HTTP idempotence> concerns repeated intended effects, not identical response messages. A repeated replacement can leave the same state while returning a different <HTTP status code> because the resource already exists. An <HTTP safe method> requests essentially read-only semantics; incidental activities such as logging do not make every safe request a request to change the resource.<HTTP Semantics>[§§9.2.1–9.2.2, safe and idempotent methods; §§9.3.3–9.3.4, POST and PUT]{ref}
Cacheability is another property, governed by method and response rules rather than by idempotence alone. Interpret the <HTTP request method>, <HTTP header fields> and <HTTP response> together before deciding what a repeated or cached exchange means.<HTTP Semantics>[§9.2.3, methods and caching]{ref}
Back to article page