415 Unsupported Media Type

HTTP Status CodesClient (4xx)commonStatus Code: 415Last updated: todayTested on:Google ChromeNode.js v20 LTSJune 2026

The media format of the requested data is not supported by the server.

415 Unsupported Media Type Quick Fix⏱️ Est. Fix Time: 3 minutes

Usually happens because:

  • Client sending XML data (Content-Type
  • Uploading unsupported image formats (e.g.

🔍 Quick Checklist:

Meaning

The HTTP 415 Unsupported Media Type client error status code indicates that the origin server refuses to service the request because the payload is in a format not supported by this method on the target resource.

Root Causes

  • Client sending XML data (Content-Type: application/xml) to an endpoint that only processes JSON.
  • Uploading unsupported image formats (e.g. TIFF) to profile picture endpoints.
CauseFrequency
Client sending XML data (Content-Type⭐⭐⭐⭐⭐
Uploading unsupported image formats (e.g.⭐⭐⭐⭐

Common Mistakes

  • Sending HTTP requests with empty Content-Type headers when payload is present.
  • Confusing 415 (payload sent is unsupported format) with 406 (format client requested in Accept header is unsupported).

How to Fix

1Check request Content-Type headers.
2Verify client payload matches server format capabilities.
3Update server serialization configurations.

Framework-Specific Examples

Express middleware validating Content-Type headers.

Express Example
app.post('/api/data', (req, res) => {
  if (req.headers['content-type'] !== 'application/json') {
    return res.status(415).send('Unsupported Media Type: JSON only');
  }
});

Server Configuration Examples

Nginx handles format routing downstream to application.

Nginx Config
# Format handled by upstream applications

Prevention

  • Explicitly declare Content-Type headers inside all client fetch utilities.
  • Provide clear API documentation listing supported content types.

Frequently Asked Questions (FAQ)

Q: What is the difference between 406 and 415?

415 Unsupported Media Type means the *client uploaded* data in a format the server doesn't support. 406 Not Acceptable means the *client requested* the server to reply in a format the server doesn't support.

Q: Does 415 apply to file uploads?

Yes. If an endpoint expects a JPEG image but the client uploads a PDF, the server should reject the request with 415 Unsupported Media Type.

Q: Is 415 cacheable?

No. The 415 status code is not cacheable by default.

Q: How do clients resolve 415 errors?

Verify the request body structure, convert it to the expected format (e.g. serialize to JSON), and make sure the 'Content-Type' header matches.

Still having this problem?

Didn't solve your problem?

SuggestRequest Error