headers property
Get the request headers to be sent with this HTTP request.
Implementation
@override
Map<String, String> get headers {
// If the request has been sent, the headers are effectively frozen.
// To respect this, an unmodifiable Map is returned.
if (isSent) return Map<String, String>.unmodifiable(_headers);
// Otherwise, the underlying case-insensitive Map is returned, which allows
// modification of the individual headers.
return _headers;
}