HTTP 415 Unsupported Media Type vs 422 Unprocessable Content
Both HTTP 415 (Unsupported Media Type) and 422 (Unprocessable Content) belong to the 4xx Client Error category. 415 indicates that the server refuses to accept the request because the Content-Type is not supported. Meanwhile, 422 means that the server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
Description
The server refuses to accept the request because the Content-Type is not supported.
When You See It
When sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
How to Fix
Set the correct Content-Type header matching the data format you're sending.
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.
Key Differences
HTTP 415: The server refuses to accept the request because the Content-Type is not supported.
HTTP 422: The server understands the content type and syntax, but was unable to process the contained instructions. Common in API validation errors.
You encounter 415 when when sending JSON to an endpoint that only accepts XML, or missing the Content-Type header.
You encounter 422 when when form validation fails — correct syntax but invalid data (e.g., email format wrong, date in the past).
When to Use Which
For 415 (Unsupported Media Type): Set the correct Content-Type header matching the data format you're sending. For 422 (Unprocessable Content): Check the response body for specific validation errors and correct the input data.