HTTP Method
The request token that states the intended operation on an HTTP resource and carries standardized safety, idempotency, and caching semantics.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/http-method/
01What it means
An HTTP method identifies the purpose of a request. Standard methods include GET for retrieval, POST for resource-specific processing, PUT for replacing state, PATCH for partial modification, and DELETE for removal. Their meanings include properties such as safety and idempotency; they are not merely CRUD labels.[1][2]
| Method | Primary intent | Protocol property |
|---|---|---|
| GET | Retrieve a representation | Safe; idempotent; cacheable by definition |
| POST | Resource-specific processing | Not inherently idempotent |
| PUT | Create or replace target state | Idempotent |
| PATCH | Apply partial modification | Not inherently idempotent |
| DELETE | Remove target association | Idempotent semantics |
Safety, idempotency, cacheability, preconditions, side effects, authorization, and retry behavior must agree with the operation.
02Why it matters
Clients, servers, caches, crawlers, retry mechanisms, and security controls make decisions from method semantics. Choosing accurately makes an interface more predictable and reduces unintended changes, duplicate effects, and broken caching.
03When to use it
Select a standard method whenever an HTTP interaction fits its defined semantics. Define or use extensions only when standard methods cannot express the operation and every relevant participant can understand the new method.
04How it works
- Identify whether the operation retrieves state, changes it, or asks a resource to process submitted content.
- Choose the standard method whose defined semantics match that intent.
- Determine whether the operation is safe, idempotent, and cacheable and design side effects accordingly.
- Specify accepted content, preconditions, authorization, successful responses, and failures.
- Test behavior through clients, retries, caches, gateways, and access controls rather than testing routing alone.
05A practical example
A document API uses GET to retrieve a document and PUT to replace it at a known URL. If a client loses the PUT response, it can repeat the same request without intending an additional change, while a POST that creates a new document needs an idempotency strategy before automatic retry.
06Where it breaks
A method communicates protocol intent but cannot guarantee that an implementation honors it. Applications may need domain-specific operations that map imperfectly to CRUD, and idempotent protocol semantics do not eliminate concurrent-update or duplicate-request concerns.
Common mistakes
- Using GET for an operation that changes state, making crawlers and retries unsafe.
- Assuming POST always means create or PUT always means update without reading their actual semantics.
- Confusing idempotent with having no side effects or always returning the same response.
- Returning success for methods an endpoint does not actually support.
07Sources
- HTTP Semantics: MethodsRFC Editor · Internet StandardHTTP Semantics: Methods
- HTTP Request MethodsMDN Web Docs · Official technical documentationHTTP Request Methods