HTTP Methods Reference
When to use each method, idempotency, safety, and cacheability at a glance.
| Method | Description | Body | Idempotent | Safe | Cacheable |
|---|---|---|---|---|---|
| GET | Retrieve a resource. Should not modify server state. Fetching data: user profiles, product lists, search results. | No | Yes | Yes | Yes |
| POST | Submit data to create a new resource or trigger a process. Creating records, submitting forms, uploading files. | Yes | No | No | Rarely |
| PUT | Replace a resource entirely with the request body. Full update of a resource. Client sends the complete representation. | Yes | Yes | No | No |
| PATCH | Apply partial modifications to a resource. Partial update: change just the email field on a user record. | Yes | No* | No | No |
| DELETE | Remove a resource. Deleting records. Should return 204 on success, 404 if already gone. | Optional | Yes | No | No |
| HEAD | Same as GET but without the response body. Checking if a resource exists, reading Content-Length before downloading. | No | Yes | Yes | Yes |
| Describe the communication options for a resource. CORS preflight requests. Returns allowed methods and headers. | No | Yes | Yes | No |
*PATCH can be idempotent depending on implementation, but the spec does not guarantee it.