HTTP Status Codes - Quick Cheat Sheet
✅ Success:
✅ 200 OK: Request completed successfully
🆕 201 Created: New resource has been created
📝 204 No Content: Successful, but nothing to return
🔁 Redirects:
🔀 301 Moved Permanently: Resource moved to a new URL
↪️ 302 Found: Temporary redirect
🧾 304 Not Modified: Use cached response
⚠️ Client Errors:
🙅 400 Bad Request: Invalid input
🪪 401 Unauthorized: Missing or invalid auth
🚫 403 Forbidden: Authenticated but not allowed
❓ 404 Not Found: Resource doesn’t exist
⏳ 408 Request Timeout: Client took too long
🧯 409 Conflict: Version/state conflict
🔥 Server Errors:
💥 500 Internal Server Error: Server crashed
🛠 502 Bad Gateway: Upstream server failed
🕸 503 Service Unavailable: Server overloaded / maintenance
⌛️ 504 Gateway Timeout: Upstream took too long
Pro Tips:
🎯 Return accurate status codes: don’t always default to 200/500
📦 Include structured error responses (code, message, details)
🛡 Don’t expose stack traces in production
⚡️ Pair 304 with ETag / If-None-Match for efficient caching
Post #3127
9.13K
- ❤ 22
- 🔥 2