Set a header
@param string $name The name of the header
@param string $value The value
322241
public function setHeader(string $name, string $value)
    {
        // Make sure the word has no spaces but dashes instead, and is
        // Camel-Cased. The dashes are first replaced with spaces to let
        // ucwords function properly, and afterwards all spaces are converted
        // to dashes.
        $name = ucwords(strtolower(str_replace('-', ' ', $name)));
        $name = str_replace(' ', '-', $name);

        $this->headers[$name] = $value;
        return $this;
    }
308798
public function setDefaultHeader(string $name, string $value) {
        $this->defaultHeaders[$name] = $value;
        return $this;
    }
765478
protected function setHeader($name, $value)
    {
        $this->headers[strtolower($name)] = new Header($name, $value);
    }
814033
public function addHeader($name, $value)
    {
        if (isset($this->headers[$name])) {
            if (is_array($this->headers[$name])) {
                $this->headers[$name][] = $value;
            } else {
                $this->headers[$name] = $value;
            }
        } else {
            $this->headers[$name] = [$value];
        }

        return $this;
    }
261392
public function add($name, $value = '')
    {
        Types::assert(['string' => [$name, $value]]);

        $key = strtolower($name);
        if ( ! array_key_exists($key, $this->headers))
        {
            $this->headers[$key] = [];
        }

        $this->headers[$key][] = HeaderFactory::build($name, $value);
    }
488912
public function AddCustomHeader($name, $value=null) {
	if ($value === null) {
		// Value passed in as name:value
		$this->CustomHeader[] = explode(':', $name, 2);
	} else {
		$this->CustomHeader[] = array($name, $value);
	}
  }
173766
public function setHeader(string $name, $value) : Message
    {
        $name = strtolower($name);
        $this->headers[$name] = is_array($value) ? array_values($value) : [$value];

        return $this;
    }
578501
protected function setHeader(string $name, $value)
    {
        if (!$this->isHeaderNameValid($name)) {
            throw new InvalidHeaderException('Header name is invalid.');
        }

        $normalized = strtolower($name);
        $value = $this->filterHeader($value);

        // Header may have been previously set with a different case. If so, remove that header.
        if (isset($this->headerNameMap[$normalized]) && $this->headerNameMap[$normalized] !== $name) {
            unset($this->headers[$this->headerNameMap[$normalized]]);
        }

        $this->headerNameMap[$normalized] = $name;
        $this->headers[$name] = $value;
    }
1213549
public function withHeader($name, $value)
    {
        $instance = clone $this;
        $instance->headers->set($name, $value);
        return $instance;
    }
1125805
protected function _setHeader($header, $value)
    {
        $normalized = strtolower($header);
        $this->headerNames[$normalized] = $header;
        $this->headers[$header] = [$value];
    }
11631
public function withHeader(string $key, string $value): void
    {
        $this->headers[$key] = $value;
    }
590008
protected function setParam($name, $value) {
        $params = $this->getParams();
        $params->$name = $value;
        $this->setParams($params);
    }
1361771
public function setHeader($name, $value)
    {
        $name = trim($name);
        $this->headers[$name] = trim($value);

        return $this;
    }
416858
public function addHeader(string $name, string $value): void
    {
        parent::addHeader($name, $value);
    }
410901
public function header($name, $value = null)
    {
        if (!is_null($value)) {
            $this[$name] = $value;
        }

        return $this[$name];
    }
780094
public function add(string $name, string $value): void
    {
        $key = strtolower($name);
        if (!isset($this->headers[$key])) {
            $this->headers[$key] = [$name, $value];

            return;
        }

        $this->headers[$key] = [$name, $this->headers[$key][1] . ', ' . $value];
    }
728508
public function addHeader(string $name, string $value): Response
    {
        $this->headers->add($name, $value);
        return $this;
    }