HTTP 422 Unprocessable Content vs 503 Service Unavailable
HTTP 422 (Unprocessable Content) is a 4xx Client Error response, while 503 (Service Unavailable) is a 5xx Server Error response. 422 indicates that the server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors. In contrast, 503 means that the server is temporarily unable to handle the request due to maintenance or overload. Should include a Retry-After header.
Description
The server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
When You See It
When form validation fails — correct syntax but invalid data (e.g., email format wrong, date in the past).
How to Fix
Check the response body for specific validation errors and correct the input data.
Description
The server is temporarily unable to handle the request due to maintenance or overload. Should include a Retry-After header.
When You See It
During maintenance windows, server overload, or when the application pool is exhausted.
How to Fix
Wait and retry. Check the Retry-After header. Scale up servers if it's a capacity issue.
Key Differences
422 is a 4xx Client Error response, while 503 is a 5xx Server Error response.
HTTP 422: The server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
HTTP 503: The server is temporarily unable to handle the request due to maintenance or overload. Should include a Retry-After header.
You encounter 422 when when form validation fails — correct syntax but invalid data (e.g., email format wrong, date in the past).
You encounter 503 when during maintenance windows, server overload, or when the application pool is exhausted.
When to Use Which
For 422 (Unprocessable Content): Check the response body for specific validation errors and correct the input data. For 503 (Service Unavailable): Wait and retry. Check the Retry-After header. Scale up servers if it's a capacity issue.