contentType property

MediaType contentType

The content type of an incoming request.

Implementation

MediaType get contentType {
  if (headers?.contentType != null) {
    try {
      _contentType = MediaType.parse(headers!.contentType.toString());
    } catch (e) {
      _log.warning(
          'Invalid media type [${headers!.contentType.toString()}]', e);
    }
  }
  return _contentType;
}