public function addHeader($name, $value) {
        if (!is_string($name))  throw new IllegalTypeException('Illegal type of parameter $name: '.gettype($name));
        if (!strlen($name))     throw new InvalidArgumentException('Invalid argument $name: '.$name);

        if (!is_string($value)) throw new IllegalTypeException('Illegal type of parameter $value: '.gettype($value));
        if (!strlen($value))    throw new InvalidArgumentException('Invalid argument $value: '.$value);

        $name  = trim($name);
        $value = trim($value);

        // memorize and drop existing headers of the same name (ignore case)
        $existing = \array_intersect_ukey($this->headers, [$name => '1'], 'strCaseCmp');
        foreach ($existing as $key => $v) {
            unset($this->headers[$key]);
        }

        // combine existing and new header (see RFC), set combined header
        $existing[] = $value;
        $this->headers[$name] = join(', ', $existing);

        return $this;
    }