DevKits
415

Unsupported Media Type

4xx Client Error

Last updated:

The server refuses to process the request because the payload format is unsupported.

Description

If a client POSTs application/xml to an endpoint that only accepts application/json, return 415.

When to use

Return 415 for Content-Type mismatches in POST/PUT/PATCH requests.

Specification

RFC 9110 §15.5.16

Examples

HTTP response
HTTP/1.1 415 Unsupported Media Type
Content-Type: application/json

{"error":"Unsupported Media Type"}
Node.js (Express)
res.status(415).json({ error: "Unsupported Media Type" });
Go (net/http)
w.WriteHeader(http.StatusUnsupportedMediaType)
Python (Flask)
return jsonify({"error": "Unsupported Media Type"}), 415

Related status codes

All 4xx codes