getHeaderContentType method Null safety

ContentTypeHeader? getHeaderContentType()

Retrieves the first 'content-type' header.

Implementation

ContentTypeHeader? getHeaderContentType() {
  if (_contentTypeHeader == null) {
    final value = _getLowerCaseHeaderValue('content-type');
    if (value == null) {
      return null;
    }
    _contentTypeHeader = ContentTypeHeader(value);
  }
  return _contentTypeHeader;
}