HTTP logoHTTP BEGINNER

HTTP Status Codes

Complete reference for HTTP status codes with examples and proper usage

10 min read
httpstatus-codesapiresterrors

1xx Informational

Request received, continuing process

Provisional responses requiring client to wait or continue

100
Continue
Initial part received, continue sending
101
Switching Protocols
Upgrading to different protocol
102
Processing
Request received but not completed
103
Early Hints
Preload resources while preparing response
💡 Rarely used in practice except for WebSocket upgrades
⚡ 103 Early Hints can improve performance with preloading
📌 Most APIs skip directly to final status codes

2xx Success

Request successfully received, understood, and accepted

Most frequently used success status codes

200
OK
Standard success response
201
Created
New resource successfully created
202
Accepted
Request accepted for processing
204
No Content
Success with no response body
🟢 Use 200 for GET requests and successful updates
🟢 Use 201 for POST requests that create resources
⚡ 204 is perfect for DELETE operations
💡 202 for async operations that will complete later

Less common but important success status codes

203
Non
Authoritative Information - Modified by proxy/CDN
205
Reset Content
Clear form/document view
206
Partial Content
Range request successful
207
Multi
Status - Multiple status codes (WebDAV)
📌 206 is used for video streaming and resume downloads
💡 207 is specific to WebDAV operations
⚡ Most applications only need 200, 201, and 204

3xx Redirection

Client must take additional action to complete request

URL redirections and cache validations

301
Moved Permanently
Resource permanently moved
302
Found
Temporary redirect (may change)
303
See Other
Redirect to different resource
304
Not Modified
Use cached version
307
Temporary Redirect
Keep same HTTP method
308
Permanent Redirect
Permanent, keep method
🔄 301/308 for permanent moves (SEO important)
⚡ 304 saves bandwidth with caching
💡 307/308 preserve the original HTTP method
⚠️ 302 can change POST to GET (use 307 to prevent)

4xx Client Errors

Request contains bad syntax or cannot be fulfilled

Most frequently encountered client-side errors

400
Bad Request
Invalid request syntax
401
Unauthorized
Authentication required
403
Forbidden
No permission to access
404
Not Found
Resource doesn't exist
405
Method Not Allowed
HTTP method not supported
409
Conflict
Request conflicts with state
🔐 401 = not authenticated, 403 = not authorized
❌ 400 for validation errors and malformed JSON
📌 404 for missing resources or endpoints
⚠️ 409 for duplicate resources or version conflicts

Other important client error codes

406
Not Acceptable
Content negotiation failed
408
Request Timeout
Request took too long
410
Gone
Resource permanently deleted
413
Payload Too Large
Request body exceeds limit
422
Unprocessable Entity
Semantic validation errors
429
Too Many Requests
Rate limit exceeded
⚡ 429 for rate limiting (include Retry-After header)
💡 422 vs 400: semantic vs syntactic errors
📌 410 vs 404: permanent vs unknown deletion
🔴 413 for file upload size limits

5xx Server Errors

Server failed to fulfill a valid request

Errors occurring on the server side

500
Internal Server Error
Generic server failure
501
Not Implemented
Feature not supported
502
Bad Gateway
Invalid upstream response
503
Service Unavailable
Temporary overload/maintenance
504
Gateway Timeout
Upstream timeout
507
Insufficient Storage
Server storage full
💥 500 is the catch-all for unexpected errors
🔧 503 with Retry-After header for maintenance
⏱️ 502/504 indicate proxy or gateway issues
📌 Log 5xx errors for debugging and monitoring

Quick Reference Guide

Most commonly used status codes at a glance

Standard status codes for RESTful operations

GET Requests

Resource found:200 OK
Not found:404 Not Found
Unauthorized:401 Unauthorized

POST Requests

Created:201 Created
Invalid:400 Bad Request
Duplicate:409 Conflict

PUT/PATCH Requests

Updated:200 OK
Not found:404 Not Found
Invalid:422 Unprocessable

DELETE Requests

Deleted:204 No Content
Not found:404 Not Found
Conflict:409 Conflict
🎯 Always use the most specific status code
💡 Include error details in response body
⚡ Use consistent patterns across your API
📌 Document your API's status code usage

More HTTP Cheat Sheets