Set header.
@notice All these stored headers should be sent before sending the last output to the client
with self.send() method.
@param  string  $name
@param  ?string $value
@return self
502710
public final function setHeader(string $name, ?string $value): self
    {
        if ($this->type == self::TYPE_REQUEST) {
            throw new HttpException('You cannot modify request headers');
        }

        $this->headers[$name] = $value;

        return $this;
    }
765478
protected function setHeader($name, $value)
    {
        $this->headers[strtolower($name)] = new Header($name, $value);
    }
410901
public function header($name, $value = null)
    {
        if (!is_null($value)) {
            $this[$name] = $value;
        }

        return $this[$name];
    }
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;
    }
1261506
protected function setHeader(string $name, string $value)
    {
        $normalized = $this->normalizeHeaderKey($name);
        $this->headerNames[$normalized] = $name;
        $this->headers[$name] = $this->trimHeaderValues([$value]);
    }
1328351
public function set(string $name, string $value): void
    {
        $this->dataContainer[RequestDataContainer::VAR_HEADER_RAW][$name] = $value;
    }
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;
    }
952285
public function usingHeader(string $key, $value): self
    {
        $this->headers->put($key, $value);
        return $this;
    }
1189952
public function addHeader(string $name, string $value = null)
    {
        if (!is_null($value)) {
            return $this->set('headers', $name, $value);
        }

        return $this->set('headers', $name, null);
    }
1001517
public function withHeader($name, $value) : self
    {
        $new = clone $this;

        return $new->setResponse($this->response->withHeader($name, $value));
    }
1216756
public function setHeader(string $header, $value): self
    {
        $this->header->set($header, $value);

        return $this;
    }
947972
public function setPost(string $name, $value) : self
    {
        $this->post[$name] = $value;

        return $this;
    }
1043833
public function set($name, $value)
    {
        $name = strtolower($name);

        if (isset($this->obj_headers[$name])) {
            $this->{$this->obj_headers[$name]} = $value;
        }
        else {
            $this->others[$name] = $value;
        }
    }
351310
public function withHeader($name, $value)
    {
        $new = clone $this;
        $name = $this->normalizeHeaderName($name);
        $new->_environment[$name] = $value;

        return $new;
    }
492488
public function addHeader(string $header, $value): self
    {
        $this->header->set($header, $value, false);

        return $this;
    }
728508
public function addHeader(string $name, string $value): Response
    {
        $this->headers->add($name, $value);
        return $this;
    }
776055
public function setHeader($name, $value)
	{
		$this->getComposer()->setHeader($name, $value, CHARSET);
		return $this;
	}