HTTP 415 — Unsupported Media Type
HTTP 415 is a format refusal: the body arrived in a media type the endpoint does not understand — XML to a JSON-only API, or a missing Content-Type that forced the server to guess wrong.
When 415 shows up
- API clients posting payloads without setting Content-Type.
- Integrations sending legacy formats to modern endpoints.
Mocking a 415 response
A response with this status can be faked end to end with a local mock rule — no backend changes needed. The configuration below mirrors the rule fields the ApiSimul editor uses (method, path, status, delay in milliseconds, response body):
{
"method": "GET",
"path": "/api/users",
"status": 415,
"delay": 170,
"enabled": true,
"body": {
"error": "unsupported_media_type",
"expected": "application/json"
}
}Dynamic placeholders such as {{random.name}}, {{string.uuid}} or {{number.int 1 100}} can appear inside the body to vary each response, which keeps client-side list rendering and retry logic honest during development.
Frequently asked questions
What does HTTP 415 mean?
The request’s media type is not supported by this resource. Setting the Content-Type the endpoint documents resolves it.
How can I test a 415 response without a real backend?
Define a mock rule with the method and path your client requests and set the status to 415. The example configuration above returns this response after the listed delay, so the client exercises its 415 handling exactly as it would against a live server.
Related status codes
Need the response in your own project? Spin up rules for any status with the ApiSimul mock server, or browse every status code page.