parseContentType function

ContentType parseContentType(
  1. String value
)

Returns an instance of ContentType of the given mime type, such as text/html; charset=utf-8.

For example,

response.headers.contentType =
  parseContentType('text/html; charset=utf-8');

It is the same as ContentType.parse, except it caches the result to speed up the parsing.

Implementation

ContentType parseContentType(String value)
=> _rawCtypes[value] ?? (_rawCtypes[value] = ContentType.parse(value));