Why 415 Unsupported Media Type Happens (and How to Fix It Fast)
A practical problem page for debugging 415 errors with exact header checks and copy-ready fixes.
Most 415 errors are not backend logic bugs. They come from mismatched Content-Type, malformed parameters, or body/header mismatch. This page gives a direct troubleshooting path.
Tools in this guide
Symptoms
- API returns HTTP 415 right after request hits server.
- Same endpoint works in Postman but fails in frontend/client SDK.
- Multipart upload fails even though file bytes are present.
Root Cause
- Content-Type header does not match body format (JSON/form-data/text).
- Header has malformed params, such as invalid charset or missing boundary.
- Gateway/proxy rewrites Content-Type and drops required parameters.
Fix Steps
- Paste raw Content-Type lines into Content-Type Parser and confirm normalized output.
- If multipart is used, verify boundary exists and matches body separators.
- Regenerate canonical header with Content-Type Generator, then retest request.
Known-good JSON request header
Content-Type: application/json; charset=utf-8
Accept: application/jsonRelated Tool Workflow
FAQ
Can 415 happen even when JSON is valid?
Yes. 415 is about media type contract, not JSON syntax only.
Should I set charset for JSON?
Using utf-8 explicitly is a safe default for mixed environments.