value method
Convenience method for the value for a single valued header.
The value must not have more than one value.
Returns null
if there is no header with the provided name.
Implementation
@override
String? value(String name) {
if (_headers[name] == null) {
return null;
}
if (_headers[name]!.length > 1) {
throw StateError('More than one value for header $name');
}
return _headers[name]?.first;
}