set method

  1. @override
void set(
  1. String name,
  2. Object value, {
  3. bool preserveHeaderCase = false,
})
override

Sets the header name to value.

Removes all existing values for the header named name and then adds value to it.

Implementation

@override
void set(String name, Object value, {bool preserveHeaderCase = false}) {
  // Dart 2.8 adds the preserveHeaderCase option
  final lcName = name.toLowerCase();

  _data[lcName] = [value.toString()];

  _originalHeaderNames[lcName] = preserveHeaderCase ? name : lcName;
}