add method

void add(
  1. String name,
  2. Object value
)

Adds a header value. The header named name will have the value value added to its list of values.

If the value is of type DateTime a HTTP date format will be applied. If the value is a List each element of the list will be added separately.

For all other types the default toString method will be used.

Implementation

void add(String name, Object value) {
  if (value is List) {
    for (int i = 0; i < value.length; i++) {
      _addValue(name, value[i]);
    }
  } else {
    _addValue(name, value);
  }
}