Setting response headers.

@param string $name
@param string $value

@author Seven Du <shiweidu@outlook.com>
423023
public function setHeader(string $name, string $value)
    {
        switch ($this->type) {
            case 'psr-7':
                $this->response = $this->response->withHeader($name, $value);
                break;

            case 'laravel':
            case 'symfony':
                $this->response->headers->set($name, $value);
                break;

            case 'thinkphp':
                $this->response->header($name, $value);
                break;

            default:
                $this->response[$name] = $value;
                break;
        }

        return $this;
    }
1271178
public function addHeader($name, $value)
    {
        $name = strtolower($name);
        $this->headers[$name] = $value;
        return $this;
    }
854819
public function header($name, $value=null) 
    {
        if (is_array($name)) {
            $this->def['header'] = array_merge($this->def['header'], $name);
        } else {
            $this->def['header'][$name] = $value;
        }
        return $this;
    }
97029
public function addHeader(string $name, $value)
    {
        parent::addHeader($name, $value);

        if (\stripos($name, "cookie") === 0) {
            $this->setCookiesFromHeaders();
        }
    }
277013
public function header($name, $value)
        {
            $this->foundation->headers->set($name, $value);
            return $this;
        }
673620
public function addHeader($name, $value)
    {
        Validate::isString($name, 'name');
        Validate::isString($value, 'value');

        $this->_headers[$name] = $value;
    }
741708
public function header($name, $value = null)
    {
        if (func_num_args() < 2) {
            return $this->request->getHeader($name);
        }
        if (is_null($value)) {
            $this->response->withoutHeader($name);
        } else {
            $this->setHeader($name, $value);
        }
        return $this;
    }
1166110
public function addOptionalHeader($name, $value)
    {
        Validate::isString($name, 'name');
        Validate::isString($value, 'value');

        if (!empty($value)) {
            $this->_headers[$name] = $value;
        }
    }
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];
    }
666568
public function setHeader(string $name, string $value): void
    {
        $this->headers->set($name, $value);
    }
981418
protected function setHeaderInResponse($name, array $values)
    {
        $name = ucwords($name, '-');

        foreach ($values as $value) {
            $this->response->header($name, $value);
        }
    }
110058
public function addHeader(string $name, $value) : Message
    {
        $name = strtolower($name);

        if (is_array($value)) {
            $value = array_values($value);
            $this->headers[$name] = isset($this->headers[$name])
                ? array_merge($this->headers[$name], $value)
                : $value;
        } else {
            $this->headers[$name][] = $value;
        }

        return $this;
    }
865785
public final function header(string $name, string $value = null)
    {
        return ($value === null) ? $this->getHeader($name) : $this->setHeader($name, $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;
    }
737155
public function responseHeaderEquals($name, $value)
    {
        $actual = $this->session->getResponseHeader($name);
        $message = sprintf('Current response header "%s" is "%s", but "%s" expected.', $name, $actual, $value);

        $this->assert($value === $actual, $message);
    }
308798
public function setDefaultHeader(string $name, string $value) {
        $this->defaultHeaders[$name] = $value;
        return $this;
    }
938108
public function add(string $name, $value)
    {
        switch ($name) {
            case 'alg':
                $this->setAlgorithm($value);
                break;
            default:
                $this->headers[$name] = $value;
                break;
        }
    }