HTTP Methods & Status Codes Cheatsheet
Quick reference for HTTP methods (GET, POST, PUT, DELETE) and common status codes with examples.
| Item | Description | Example | Category |
|---|---|---|---|
| GET | Retrieve resource | GET /users | Method |
| POST | Create resource | POST /users { "name": "John" } | Method |
| PUT | Update/replace resource | PUT /users/1 { "name": "Jane" } | Method |
| PATCH | Partial update | PATCH /users/1 { "name": "Jane" } | Method |
| DELETE | Delete resource | DELETE /users/1 | Method |
| HEAD | Retrieve headers only | HEAD /users | Method |
| OPTIONS | Check allowed methods | OPTIONS /users | Method |
| 200 OK | Request successful | GET /users → 200 OK | Status |
| 201 Created | Resource created | POST /users → 201 Created | Status |
| 204 No Content | Request successful, no response body | DELETE /users/1 → 204 No Content | Status |
| 301 Moved Permanently | Resource moved permanently | GET /old → 301 | Status |
| 302 Found | Resource found temporarily | GET /temp → 302 | Status |
| 400 Bad Request | Client error, invalid request | POST /users → 400 | Status |
| 401 Unauthorized | Authentication required | GET /private → 401 | Status |
| 403 Forbidden | Access forbidden | GET /admin → 403 | Status |
| 404 Not Found | Resource not found | GET /unknown → 404 | Status |
| 500 Internal Server Error | Server error | GET /users → 500 | Status |
| 502 Bad Gateway | Invalid response from upstream server | GET /api → 502 | Status |
| 503 Service Unavailable | Server temporarily unavailable | GET /api → 503 | Status |