set method

void set (
  1. String name,
  2. String 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, String value) {
  name = name.toLowerCase();
  List<String> values = new List<String>();
  headers[name] = values;
  values.add(value);
}