defaultMimeTypes property

Map<String, ContentType> defaultMimeTypes
read / write

Default MIME types.

This is used for matching file extensions to MIME types. The file extensions are strings without the full stop (e.g. "png").

This list is only examined if a match was not found in the local mimeTypes. If a match could not be found in this global map, the default of ContentType.binary is used.

This list contains values for extensions such as: txt, html, htm, json, css, png, jpg, jpeg, gif, xml, js, dart. Note: only lowercase extensions will match.

Implementation

static Map<String, ContentType> defaultMimeTypes = {
  "txt": ContentType.text,
  "html": ContentType.html,
  "htm": ContentType.html,
  "json": ContentType.json,
  "css": new ContentType("text", "css"),
  "png": new ContentType("image", "png"),
  "jpg": new ContentType("image", "jpeg"),
  "jpeg": new ContentType("image", "jpeg"),
  "gif": new ContentType("image", "gif"),
  "xml": new ContentType("application", "xml"),
  "js": new ContentType("application", "javascript"),
  "dart": new ContentType("application", "dart"),
}