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) {
name = _validateField(name);
List<String>? values = _headers[name];
if (values == null) return null;
assert(values.isNotEmpty);
if (values.length > 1) {
throw HttpException("More than one value for header $name");
}
return values[0];
}