RFC 2045 standard. "> API Docs - Object : MediaType

Object - mime : MediaType

Describes the nature of the data in the body of a MIME entity.

Methods

Gets the “primaryType/subtype+suffix” combination in a string format.

Converts the media type to a string, which is suitable to be used as the value of a corresponding HTTP header.

Fields

  • primaryType string
  • Declares the general type of data

  • subType string
  • A specific format of the primary-type data

  • suffix string
  • Identifies the semantics of a specific media type

  • parameters map (default {})
  • A set of parameters specified in an attribute=value notation

getBaseType

()

returns string

Gets the “primaryType/subtype+suffix” combination in a string format.

 string baseType = mediaType.getBaseType();
  • Return Type

    (string)
  • Base type as a string from the MediaType struct

toString

()

returns string

Converts the media type to a string, which is suitable to be used as the value of a corresponding HTTP header.

 string mediaTypeString = mediaType.toString();
  • Return Type

    (string)
  • Content type with parameters as a string