headers property Null safety

Map<String, dynamic> headers
inherited

Http request headers. The keys of initial headers will be converted to lowercase, for example 'Content-Type' will be converted to 'content-type'.

The key of Header Map is case-insensitive, eg: content-type and Content-Type are regard as the same key.

Implementation

Map<String, dynamic> get headers => _headers;
void headers=(Map<String, dynamic>? headers)
inherited

Implementation

set headers(Map<String, dynamic>? headers) {
  _headers = caseInsensitiveKeyMap(headers);
  if (_defaultContentType != null &&
      !_headers.containsKey(Headers.contentTypeHeader)) {
    _headers[Headers.contentTypeHeader] = _defaultContentType;
  }
}