2026-02-26 17:08:49 +05:30
|
|
|
class HTTPStatus:
|
2026-07-30 14:38:37 +05:30
|
|
|
# ==========================
|
|
|
|
|
# 2xx Success
|
|
|
|
|
# ==========================
|
|
|
|
|
OK = 200 # Request successful
|
|
|
|
|
CREATED = 201 # Resource created successfully
|
|
|
|
|
ACCEPTED = 202 # Request accepted for processing
|
|
|
|
|
NO_CONTENT = 204 # Success, no response body
|
|
|
|
|
|
|
|
|
|
# ==========================
|
|
|
|
|
# 4xx Client Errors
|
|
|
|
|
# ==========================
|
|
|
|
|
BAD_REQUEST = 400 # Invalid request
|
|
|
|
|
UNAUTHORIZED = 401 # Authentication required
|
|
|
|
|
FORBIDDEN = 403 # Access denied
|
|
|
|
|
NOT_FOUND = 404 # Resource not found
|
|
|
|
|
METHOD_NOT_ALLOWED = 405 # HTTP method not allowed
|
|
|
|
|
CONFLICT = 409 # Resource conflict (e.g., duplicate)
|
|
|
|
|
UNPROCESSABLE_ENTITY = 422 # Validation error
|
|
|
|
|
TOO_MANY_REQUESTS = 429 # Rate limit exceeded
|
|
|
|
|
|
|
|
|
|
# ==========================
|
|
|
|
|
# 5xx Server Errors
|
|
|
|
|
# ==========================
|
|
|
|
|
INTERNAL_SERVER_ERROR = 500 # Internal server error
|
|
|
|
|
NOT_IMPLEMENTED = 501 # Feature not implemented
|
|
|
|
|
BAD_GATEWAY = 502 # Invalid response from upstream server
|
|
|
|
|
SERVICE_UNAVAILABLE = 503 # Server temporarily unavailable
|
|
|
|
|
GATEWAY_TIMEOUT = 504 # Upstream server timeout
|