set method

void set(
  1. String name,
  2. dynamic value
)

Sets a header. The header named name will have all its values cleared before the value value is added as its value.

Implementation

void set(String name, dynamic value) {
  if (value == null) {
    return;
  }
  name = name.trim();
  if (value is List) {
    _map[name] = value.map<String>((e) => '$e').toList();
  } else {
    _map[name] = ['$value'.trim()];
  }
}