The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
“Invalid media type” usually means either that a media-type value is malformed or that a server does not accept the request’s content format. The phrase alone does not identify one universal error code. If an HTTP server rejects a request because its content format is unsupported for that method and resource, it may return 415 Unsupported Media Type.
What is a media type?
A media type identifies the format of a representation and how it should be processed. In HTTP, Content-Type describes the format of the representation being sent, while Accept indicates which response formats the client can handle.
The basic syntax is type/subtype, optionally followed by semicolon-separated parameters. Examples include application/json, text/html, and text/html; charset=UTF-8. The type and subtype are case-insensitive; parameter value rules can depend on the parameter.
Free tools Windows power users keep installed
One-click scans. No signup required.
Does “invalid media type” mean malformed or unsupported?
It can mean either, and the distinction matters when troubleshooting:
#1 Best Overall
- Malformed: A parser cannot interpret the value, for example because the type/subtype syntax or a parameter is invalid.
- Unsupported: The value is syntactically interpretable, but the endpoint does not accept that format for the particular method and resource.
Parser behavior depends on the implementation. Go’s mime.ParseMediaType, for example, normalizes the base media type to lowercase and returns errors for invalid type/subtype syntax or malformed parameters. Spring Framework documents InvalidMediaTypeException for an invalid media-type specification string.
What does HTTP 415 Unsupported Media Type mean?
RFC 9110 defines 415 as a response indicating that the origin server refuses a request because its content is in a format not supported by the method on the target resource. A 415 is an HTTP status code; a parser exception such as Spring’s InvalidMediaTypeException is a framework-level diagnostic. A service’s exact behavior depends on its implementation.
A 415 does not prove that the Content-Type header is misspelled. RFC 9110 says the cause can be the indicated Content-Type, the request’s Content-Encoding, or the server’s inspection of the data itself. If the issue is an unsupported media type, a response can use Accept to indicate acceptable types; if it is an unsupported content coding, it can use Accept-Encoding.
Do not confuse 415 with 422 Unprocessable Content. RFC 9110 distinguishes 422 for a request whose content type is understood and syntax is correct, but whose instructions cannot be processed.
Rank #3
How to troubleshoot an invalid media type error
- Identify where the error occurred. Determine whether you received an HTTP response, such as 415, or a parser/framework exception. The distinction helps separate endpoint rejection from syntax parsing.
- Check the request’s
Content-Type. Compare the full value, including subtype and parameters, with the endpoint’s documented accepted request types. - Make sure the header matches the body. For example, a JSON-encoded request body should normally be labeled
application/jsonwhen that is what the endpoint expects. Follow the endpoint’s requirements rather than assuming every server accepts JSON. - For a parser exception, inspect the syntax. Check the type/subtype slash, punctuation, semicolon-separated parameters, and parameter values. The parser’s error message and documentation determine what that implementation accepts.
- For a 415, check more than the media type. Confirm the endpoint supports the request format and check whether the response points to an unsupported content coding.
- If you are choosing a response format, inspect
Accept. Changing the request body’sContent-Typewill not fix a problem with the response format the client requested. Cornice documents 406 when a service cannot provide a type requested throughAccept, and 415 when requestContent-Typevalidation fails.
Which HTTP header should you check?
| Header or status | What it concerns | When to check it |
|---|---|---|
Content-Type |
Format of the representation sent in the request | The server rejects the submitted body or reports a request media-type problem |
Accept |
Response formats the client wants | The client cannot obtain its requested response format; a framework may report 406 |
Content-Encoding |
Coding applied to the request content | A 415 may be caused by a coding the server does not support |
| 415 Unsupported Media Type | Server refuses the request content for the method and resource | Check the accepted request formats, content coding, and whether the server rejects the body itself |
| 422 Unprocessable Content | Content type is understood and syntax is correct, but instructions cannot be processed | The failure concerns processing the request rather than recognizing its format |
Sources and scope
The HTTP definitions and distinctions above come from RFC 9110, published in June 2022. Implementation examples are documented in Go’s official mime package documentation, Spring Framework 6.2.18 API documentation, and Cornice 2.0.1 documentation. Error wording and handling can vary between parsers, frameworks, and endpoints.
Quick Recap
Best Value
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

