HTTPError.net

The fastest way to diagnose, understand, and fix any HTTP status code

415 Unsupported Media Type

Fault: Client
TL;DR

Server refuses request because payload format is unsupported.

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

What HTTP 415 Unsupported Media Type Means

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

Server refuses request because payload format is unsupported.

Common Causes

How to Fix It (For Visitors)

How to Fix It (For Developers/Admins)

Returning a 415 Unsupported Media Type (Code Examples)

If you build APIs or web apps, here is how to send an HTTP 415 response and how to test for it:

Node.js (Express)

app.get('/resource', (req, res) => {
  res.status(415).json({ error: 'Unsupported Media Type' });
});

Python (Flask)

@app.route('/resource')
def resource():
    return jsonify(error='Unsupported Media Type'), 415

PHP

<?php
http_response_code(415);
header('Content-Type: application/json');
echo json_encode(['error' => 'Unsupported Media Type']);

Check the status with curl

curl -I https://example.com/resource
# Look for: HTTP/1.1 415 Unsupported Media Type

Frequently Asked Questions

What does HTTP 415 Unsupported Media Type mean?

Server refuses request because payload format is unsupported. In short: The media format of the requested data is not supported by the server.

Is 415 Unsupported Media Type a client or server error?

415 is a 4xx client-error code, so the request itself needs to change. The server is running normally and is rejecting the request as it was sent by the browser, app, or API client.

How do I fix a 415 Unsupported Media Type error?

Set correct Content-Type header. Check API accepts your data format. Verify Accept header.

Official Specification

The 415 Unsupported Media Type status code is defined in RFC 7231 Section 6.5.13.

View the IANA HTTP Status Code Registry →