Skip to main content
HTTP/4xx (Client Error)

415 Unsupported Media Type

The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.

❓ Why does this happen?

Missing or incorrect Content-Type header (e.g. sending text/plain when application/json is required).

✅ How to fix it

Set the correct Content-Type request header matching the format accepted by the server.

Return or handle 415 in your stack

// app/api/resource/route.ts
export function GET() {
  return Response.json(
    { error: "Unsupported Media Type", status: 415 },
    {
      status: 415
    }
  );
}

Live 415 mock endpoint

Point your app, tests, or retry logic at this free public URL to reproduce a real 415 response (CORS enabled, optional ?delay=ms up to 5000).

https://castov.com/api/mock/415

Frequently Asked Questions

What does HTTP Status 415 mean?
The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource.
Why am I getting a 415 status code?
Missing or incorrect Content-Type header (e.g. sending text/plain when application/json is required).
How do I fix a 415 Unsupported Media Type error?
Set the correct Content-Type request header matching the format accepted by the server.
How can I test how my app handles a 415 response?
Send a request to https://castov.com/api/mock/415 — it returns a real 415 Unsupported Media Type response with CORS enabled. Add ?delay=2000 to simulate a slow server.

Other 4xx status codes

Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.