REST and Hypermedia: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 23: Line 23:
A '''media type''', also called a '''content type''' or '''MIME type''' is a two-part string identifying the format of a document. Usually, knowing a document's format allows us to parse it. IANA (Internet Assigned Numbers Authority) is the official authority for the standardization and publication of media types.
A '''media type''', also called a '''content type''' or '''MIME type''' is a two-part string identifying the format of a document. Usually, knowing a document's format allows us to parse it. IANA (Internet Assigned Numbers Authority) is the official authority for the standardization and publication of media types.


The media type string consists of a type and a subtype, which can be further be structured into a tree. A media type can optionally define a suffix and parameters:
The media type string consists of a type and a subtype. The subtype can be further be structured into a tree. A media type can optionally define a suffix and parameters:
   
   
  type "/" [tree "." ] subtype ["+" suffix] *[";" parameter]
  type "/" [tree "." ] subtype ["+" suffix] *[";" parameter]

Revision as of 03:04, 25 September 2018

Internal

Concepts

Multipurpose Internet Mail Extension (MIME)

MIME is an internet standard that extends the format of e-mail to support text in character sets other then ASCII, non-text attachments, such as audio, video, images, application programs, etc., message bodies with multiple parts and header information in non-ASCII characters sets. MIME is specified in six linked RFCs: RFC 2045, RFC 2046, RFC 2047, RFC 4288, RFC 4289 and RFC 2049.

MIME is relevant to HTTP. The content types define by MIME are used in the definition of HTTP content. HTTP clients use MIME content type headers to indicate the desired application to process the specific type of content they send. HTTP servers insert MIME content type information in all their responses.

MIME defines the following headers:

  • MIME-Version
  • Content-Type
  • Content-Disposition
  • Content-Transfer-Encoding

Media Type

Wikipedia Media Type

A media type, also called a content type or MIME type is a two-part string identifying the format of a document. Usually, knowing a document's format allows us to parse it. IANA (Internet Assigned Numbers Authority) is the official authority for the standardization and publication of media types.

The media type string consists of a type and a subtype. The subtype can be further be structured into a tree. A media type can optionally define a suffix and parameters:

type "/" [tree "." ] subtype ["+" suffix] *[";" parameter]

The currently registered types are: "application", "audio", "example", "font", "image", "message", "model", "multipart", "text" and "video".

An HTML file may be designated as:

text/html; charset=UTF-8