Client Error · 4xx

415 Unsupported Media Type

The server cannot parse the Content-Type of the request body.

What 415 Unsupported Media Type means

415 Unsupported Media Type means the request body is in a format the server cannot or will not parse. Common cause: sending JSON to an endpoint that expects multipart/form-data, or vice versa. The response should include an Accept header listing the Content-Types the endpoint will accept (note: this is the unusual case where Accept appears on a response, not a request).

When servers should return it: Return 415 when the request Content-Type is not one the server accepts on this endpoint.

Common causes

How to fix 415 Unsupported Media Type

Example response

curl -i -X POST -H "Content-Type: text/plain" -d "hello" https://api.example.com/users

HTTP/2 415
accept: application/json, multipart/form-data
content-type: application/json
{"error":"unsupported content-type"}

Related status codes

Frequently Asked Questions

415 vs 406?
415 is about the request body Content-Type. 406 is about the response Content-Type the client will accept.
Defined in: RFC 9110 · Class: 4xx Client Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.