Think pragmatically. The MIME type is defined as "The type of Internet media is a two-component identifier for standardizing file formats over the Internet." Value, if the data format is changed (TXT-> HTML-> JSON-> XML-> YAML-> CSV → ...), you need to change the MIME type.
However, there are other legitimate uses that are specifically mentioned by Joshua Belden above. The following is an example of how GitHub uses the MIME type to determine the version of the API.
Current version
By default, all requests receive API version v3. We ask you to explicitly request this version using the Accept header.
Accept: application / vnd.github.v3 + json
It makes sense that the data layout of the v2 request sent to the API version of v3 will be incompatible, even if they are on the same URL (and vice versa). It also helps to reduce the changes needed to move from one version of the API to the next (you do not need to update URLs, for example).
However, this does not mean that your application should, by default, use a custom MIME type for “future proof” for the version-specific API. If your application does not have a large external API with many public consumers, you most likely do not need the MIME type for the user version.
In addition, the REST API endpoints should determine the structure of the data being created and consumed, and not the MIME type. For example, GET "/ clients / 5" should only produce data that has been serialized from your Customer object. And the POST "/ reservation" should only consume data that is properly de-serialized for your reservation. This means that your endpoint serialization will handle syntax checking and should return level 400 code and explain that the data provided is not structured properly.
Another example from the GitHub API that emphasizes this behavior.
HTTP/1.1 422 Unprocessable Entity Content-Length: 149 { "message": "Validation Failed", "errors": [ { "resource": "Issue", "field": "title", "code": "missing_field" } ] }
To summarize, most serialization schemes go out of the box, waiting for processing of "application / json" and "application / xml". Although you can certainly add an individual MIME type for a specific provider, why do this if you have no reason to?
Sorry if I just created a zombie question with this answer.