HTTP 415 Unsupported Media Type
HTTP 415 Unsupported Media Type means the server will not accept the request body’s format, as stated by its Content-Type header.
Quick answer
HTTP 415 Unsupported Media Type means the server will not accept the request body’s format, as stated by its Content-Type header. The most common case is sending JSON without Content-Type: application/json, or sending form data to an endpoint that only accepts JSON.
Last updated · Maintained by FreeAIToolz · How we test
What does HTTP 415 Unsupported Media Type mean?
The server checks Content-Type (and sometimes Content-Encoding) before parsing. A mismatch or missing header triggers 415 even if the body itself is valid.
| Status code | 415 |
|---|---|
| Name | Unsupported Media Type |
| Class | 4xx Client Error |
| Defined in | RFC 9110 §15.5.16 |
| Cacheable by default | No, unless Cache-Control says so |
| Safe to retry automatically? | No: change the request first |
| Related headers | Content-Type, Accept-Post, Accept-Patch |
What causes HTTP 415?
- Missing Content-Type header.
- Wrong type (text/plain or multipart/form-data sent to a JSON endpoint).
- An unsupported Content-Encoding such as gzip on the request.
How do I fix HTTP 415?
- Send Content-Type: application/json with JSON bodies (fetch does not set it automatically).
- Document accepted types; respond with an Accept-Post or Accept-Patch header listing them.
What should a client do after HTTP 415?
Correct the Content-Type and resend.
Does HTTP 415 affect SEO?
No SEO impact.
Example 415 response
HTTP/1.1 415 Unsupported Media Type
Date: Mon, 01 Dec 2026 12:00:00 GMT
Content-Type: application/json
{"error":{"status":415,"message":"Unsupported Media Type"}} How to return 415 Unsupported Media Type in code
Express (Node.js)
res.status(415).json({ error: 'Unsupported Media Type' }); Next.js route handler
return Response.json({ error: 'Unsupported Media Type' }, { status: 415 }); FastAPI (Python)
raise HTTPException(status_code=415, detail="Unsupported Media Type") PHP
http_response_code(415); Nginx
location = /example {
return 415;
} Other 4xx status codes
The request contains an error or cannot be fulfilled as sent. Fix the request before retrying.
- 400 Bad Request
- 401 Unauthorized
- 402 Payment Required
- 403 Forbidden
- 404 Not Found
- 405 Method Not Allowed
- 406 Not Acceptable
- 407 Proxy Authentication Required
- 408 Request Timeout
- 409 Conflict
- 410 Gone
- 411 Length Required
- 412 Precondition Failed
- 413 Content Too Large
- 414 URI Too Long
- 416 Range Not Satisfiable
- 417 Expectation Failed
- 418 I'm a teapot
- 421 Misdirected Request
- 422 Unprocessable Content
- 423 Locked
- 425 Too Early
- 426 Upgrade Required
- 428 Precondition Required
- 429 Too Many Requests
- 431 Request Header Fields Too Large
- 451 Unavailable For Legal Reasons
- 499 Client Closed Request
Frequently asked questions
Why does fetch() get 415 when posting JSON?
415 vs 400?
Is 415 a client or server error?
Related
- 406 Not Acceptable HTTP 406 Not Acceptable means the server cannot produce a response in any format the client listed in its Acce.
- 400 Bad Request HTTP 400 Bad Request means the server cannot process the request because of a client error, such as malformed .
- 422 Unprocessable Content HTTP 422 Unprocessable Content (formerly Unprocessable Entity) means the server understood the request and its.
- Open the HTTP Status Codes Reference → Free, no signup.