What's the difference between mediatype, contenttype and mimetype?

HttpWebMime TypesContent Type

Http Problem Overview


Is there a difference between mimetype, contenttype and mediatype? (Java's JAX-RS MediaType).

From the wikipedia article i gathered that it's only a content-type in the context of e.g. HTTP requests as a field in a request's header: So are these just synonyms or are there any actual semantic differences between the different terms?

Http Solutions


Solution 1 - Http

(Internet) Media Type is the proper technical term.

Content-Type is the name of the HTTP header field used to specify the media type.

MIME Type is the former name for Media Type.

Solution 2 - Http

Content-Type is an HTTP message header and its value is (generally) a MIME Type.

JAX-RS MediaType seems to be a Java rewrite for common MIME Types.

Solution 3 - Http

What is MIME Specification:

Concept of MIME (Multipurpose Internet Mail Extensions) originally was developed for organizing the structure of contents of the messages transferred over SMTP protocol. However, it's adopted in other communication protocols, such as HTTP.
So Mime, is a specification! which describes how to show the structure, format and nature of some kind of data, such as a file, or body of an email, etc.

What is Content-Type

Mime, has several header-fields, which are used within protocols taking advantage of this specification. One of these header fields is Content-Type. Hence, Content-Type is not specific to HTTP protocol. A value that can be assigned to this header, is sometimes called a content type too.
There are other headers too, used for specifying the encoding of the message, or how to message should be displayed (should it be downloaded to shown or not) etc.

What is a Media Type?

Media type, formerly called mime type, is just a string. AS mentioned in MDN

> It (mime type) serves the same purpose as filename extensions traditionally do on Windows

A media type, consists of a type (such as video) and a subtype (such as 3gpp). video/3gpp is an example of media types. The list of registered media types can be seen here. In HTTP and SMTP protocols, the value of the content-type header must be a media type!


one final point:

We are not always sending just a single image file, or just some text. Sometimes our message consists of multiple parts. Not only that, but also these parts may have a nested structure. MIME is capable of showing how the parts are nested. Actually these parts can be arranged in a tree structure.
If the message has multiple parts, each part has its own Content-Type.
media type of any non-leaf node in the tree should have multipart type. Its subtype can have various values based on the leaves.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfassegView Question on Stackoverflow
Solution 1 - HttpJulian ReschkeView Answer on Stackoverflow
Solution 2 - HttpsupertopiView Answer on Stackoverflow
Solution 3 - HttpShahryar SaljoughiView Answer on Stackoverflow