HTTP Status Codes
Complete HTTP status codes reference guide for developers and API debugging. Detailed explanations for all standard HTTP response codes.
HTTP Status Code Reference
Complete reference guide for HTTP status codes with descriptions, use cases, and examples. Perfect for API development, debugging, and web development.
Continue
informationalThe server has received the request headers and the client should proceed to send the request body.
💡 Common Examples:
- •Large file uploads
- •Expect: 100-continue header
🎯 When to Use:
Rarely used in modern web development
Switching Protocols
informationalThe requester has asked the server to switch protocols and the server has agreed to do so.
💡 Common Examples:
- •WebSocket upgrade
- •HTTP/2 upgrade
🎯 When to Use:
Protocol negotiations
Processing
informationalThe server has received and is processing the request, but no response is available yet.
💡 Common Examples:
- •WebDAV operations
- •Long-running requests
🎯 When to Use:
Extended operations
OK
successThe request has succeeded. The meaning of the success depends on the HTTP method.
💡 Common Examples:
- •GET request successful
- •POST request processed
🎯 When to Use:
Most common success response
Created
successThe request has been fulfilled, resulting in the creation of a new resource.
💡 Common Examples:
- •User registration
- •File upload
- •Database record creation
🎯 When to Use:
REST API resource creation
Accepted
successThe request has been accepted for processing, but the processing has not been completed.
💡 Common Examples:
- •Async job queuing
- •Email sending
- •Background processing
🎯 When to Use:
Asynchronous operations
No Content
successThe server successfully processed the request and is not returning any content.
💡 Common Examples:
- •DELETE operations
- •PUT updates
- •Configuration changes
🎯 When to Use:
Successful operations with no response body
Partial Content
successThe server is delivering only part of the resource due to a range header sent by the client.
💡 Common Examples:
- •Video streaming
- •Large file downloads
- •Resume downloads
🎯 When to Use:
Range requests and streaming
Moved Permanently
redirectionThe URL of the requested resource has been changed permanently.
💡 Common Examples:
- •Domain changes
- •URL restructuring
- •HTTPS migration
🎯 When to Use:
Permanent redirects for SEO
Found
redirectionThe URL of the requested resource has been changed temporarily.
💡 Common Examples:
- •Temporary maintenance
- •A/B testing
- •Load balancing
🎯 When to Use:
Temporary redirects
Not Modified
redirectionIndicates that the resource has not been modified since the version specified by the request headers.
💡 Common Examples:
- •Browser caching
- •API caching
- •CDN optimization
🎯 When to Use:
Caching and performance optimization
Temporary Redirect
redirectionThe server sends this response to direct the client to get the requested resource at another URI with same method.
💡 Common Examples:
- •Method-preserving redirects
- •POST form redirects
🎯 When to Use:
Method-preserving temporary redirects
Permanent Redirect
redirectionThe resource is now permanently located at another URI, specified by the Location header.
💡 Common Examples:
- •API versioning
- •Permanent URL changes
🎯 When to Use:
Method-preserving permanent redirects
Bad Request
client errorThe server could not understand the request due to invalid syntax.
💡 Common Examples:
- •Invalid JSON
- •Missing required fields
- •Malformed requests
🎯 When to Use:
General client-side errors
Unauthorized
client errorThe client must authenticate itself to get the requested response.
💡 Common Examples:
- •Missing API key
- •Invalid credentials
- •Expired tokens
🎯 When to Use:
Authentication required
Forbidden
client errorThe client does not have access rights to the content.
💡 Common Examples:
- •Insufficient permissions
- •IP blocking
- •Resource access denied
🎯 When to Use:
Authorization failures
Not Found
client errorThe server can not find the requested resource.
💡 Common Examples:
- •Missing pages
- •Deleted resources
- •Wrong URLs
🎯 When to Use:
Resource not found
Method Not Allowed
client errorThe request method is known by the server but is not supported by the target resource.
💡 Common Examples:
- •POST to read-only resource
- •DELETE not allowed
🎯 When to Use:
HTTP method restrictions
Conflict
client errorThe request conflicts with the current state of the server.
💡 Common Examples:
- •Duplicate email
- •Version conflicts
- •Resource already exists
🎯 When to Use:
State conflicts
Gone
client errorThe resource requested is no longer available and will not be available again.
💡 Common Examples:
- •Deleted content
- •Discontinued services
🎯 When to Use:
Permanently removed resources
Unprocessable Entity
client errorThe request was well-formed but was unable to be followed due to semantic errors.
💡 Common Examples:
- •Validation errors
- •Business rule violations
🎯 When to Use:
Validation failures
Too Many Requests
client errorThe user has sent too many requests in a given amount of time.
💡 Common Examples:
- •API rate limiting
- •DDoS protection
- •Spam prevention
🎯 When to Use:
Rate limiting
Internal Server Error
server errorThe server has encountered a situation it does not know how to handle.
💡 Common Examples:
- •Application crashes
- •Database errors
- •Unhandled exceptions
🎯 When to Use:
General server errors
Not Implemented
server errorThe request method is not supported by the server and cannot be handled.
💡 Common Examples:
- •Unsupported HTTP methods
- •Missing features
🎯 When to Use:
Unimplemented functionality
Bad Gateway
server errorThe server, while working as a gateway to get a response needed to handle the request, got an invalid response.
💡 Common Examples:
- •Proxy errors
- •Upstream server issues
- •Load balancer problems
🎯 When to Use:
Gateway and proxy errors
Service Unavailable
server errorThe server is not ready to handle the request.
💡 Common Examples:
- •Maintenance mode
- •Server overload
- •Temporary outages
🎯 When to Use:
Temporary unavailability
Gateway Timeout
server errorThe server is acting as a gateway and cannot get a response in time.
💡 Common Examples:
- •Slow upstream servers
- •Network timeouts
- •Database timeouts
🎯 When to Use:
Timeout errors
Quick Reference Guide
🎯 Most Common Codes
- 200: OK - Success
- 201: Created - Resource created
- 400: Bad Request - Client error
- 401: Unauthorized - Auth required
- 404: Not Found - Missing resource
- 500: Internal Server Error
🔧 API Development
- POST Success: 201 Created
- PUT Success: 200 OK or 204 No Content
- DELETE Success: 204 No Content
- Validation Error: 422 Unprocessable Entity
- Rate Limiting: 429 Too Many Requests
🌐 Web Development
- Permanent Redirect: 301 Moved Permanently
- Temporary Redirect: 302 Found
- Caching: 304 Not Modified
- Access Denied: 403 Forbidden
- Server Down: 503 Service Unavailable
Best Practices
✅ Do's
- • Use appropriate status codes for different scenarios
- • Provide meaningful error messages in response body
- • Be consistent across your API endpoints
- • Use 2xx codes for successful operations
- • Use 4xx codes for client errors
- • Use 5xx codes for server errors
❌ Don'ts
- • Don't use 200 OK for all responses
- • Don't use 404 for authorization issues
- • Don't expose sensitive error details
- • Don't use non-standard status codes unnecessarily
- • Don't ignore the semantic meaning of codes
- • Don't mix up client and server error codes