What does HTTP status code 415 mean?
The 415 Unsupported Media Type status code indicates that the server rejects the request because the payload media format is not supported (e.g., XML payload sent to a JSON-only endpoint).
When to use it in APIs
Use 415 when checking the Content-Type header of incoming write requests. If your API requires application/json and the client sends text/xml, return a 415.
How it compares to other codes
- 406 Not Acceptable: Refuses response formats based on Accept headers, whereas 415 refuses incoming request body formats.