mediaTypeOf static method

MediaType mediaTypeOf(
  1. String? contentType
)

Parses MediaType instance from contentType.

MediaType('application', 'octet-stream') is returned if contentType is null.

Implementation

static MediaType mediaTypeOf(String? contentType) => contentType != null
    ? MediaType.parse(contentType)
    : MediaType('application', 'octet-stream');