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/415Frequently Asked Questions
What does HTTP Status 415 mean?
Why am I getting a 415 status code?
How do I fix a 415 Unsupported Media Type error?
How can I test how my app handles a 415 response?
Other 4xx status codes
Browse the full HTTP status codes directory or troubleshoot terminal errors in the Error Fix Encyclopedia.