HTTP Request Methods
RFC-standard HTTP methods, their semantics, idempotency, and when to use each.
Reference
Methods
| Method | Safe | Idempotent | Body? | Purpose |
|---|---|---|---|---|
| GET | Yes | Yes | No | Retrieve a representation of the resource. |
| HEAD | Yes | Yes | No | Like GET but returns only headers. |
| OPTIONS | Yes | Yes | No | Describe communication options (CORS preflight). |
| TRACE | Yes | Yes | No | Echo back what the server received (debugging). |
| POST | No | No | Yes | Create a new resource or submit data. |
| PUT | No | Yes | Yes | Replace the resource entirely. |
| PATCH | No | No | Yes | Apply partial modifications. |
| DELETE | No | Yes | Opt | Remove the resource. |
| CONNECT | No | No | No | Establish a tunnel (HTTPS through a proxy). |
Notes
- Safe: does not modify server state.
- Idempotent: same request N times = same state as once.
- PATCH is technically not idempotent by the RFC, though many APIs implement it idempotently.
Common Use Cases
REST API design
Pick the right verb for an endpoint.
Last updated: