Set a single response header
@param string $name
@param string $value
@param boolean $override (optional) default true
@return \Phavour\Http\Response
977726
public function setHeader($name, $value, $override = true)
    {
        if ($override == false) {
            if (array_key_exists($name, $this->headers)) {
                return $this;
            }
        }

        $this->headers[$name] = $value;
    }
39992
public function header(string $name, $value): HttpRequest
    {
        if (!array_key_exists($name, $this->headers)) {
            $this->headers[$name] = array();
        }
        $this->headers[$name][] = $value;

        return $this;
    }
365585
public function setHeader($name, $value)
    {
        $context = $this->_context;

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

        return $this;
    }
1024473
public function withAddedHeader($name, $value): self
    {
        $this->assertHeaderName($name);

        $clone = clone $this;
        $clone->headers->add($name, $value);

        return $clone;
    }
1096489
public function setHeaders($headers, $override = true)
    {
        if ($override == false) {
            $this->headers = array_merge($headers, $this->headers);
        } else {
            $this->headers = $headers;
        }

        return $this;
    }
651246
public function withAddedHeader($name, $value): self
    {
        $request = clone $this;
        $request->headers->set($name, $value, false);

        return $request;
    }
931966
public OkRequest<T> header(final String name, final String value) {
        mRequestHeaders.put(name, 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;
    }
149528
public function setVar($name, $value = null, $hash = 'method', $overwrite = true)
	{
		// If overwrite is true, makes sure the variable hasn't been set yet
		if (!$overwrite && $this->has($name))
		{
			return $this->getVar($name);
		}

		// Get the request hash value
		$hash = strtolower($hash);
		if ($hash === 'method')
		{
			$hash = strtolower($this->getMethod());
		}

		switch ($hash)
		{
			case 'server':
				$hash = 'server';
			break;

			case 'cookie':
			case 'cookies':
				$hash = 'cookies';
			break;

			case 'file':
			case 'files':
				$hash = 'files';
			break;

			case 'head':
			case 'get':
			case 'query':
				$hash = 'query';
			break;

			case 'header':
			case 'headers':
				$hash = 'headers';
			break;

			case 'post':
			case 'request':
			case 'delete':
			case 'put':
				$hash = 'request';
			break;

			default:
				$hash = 'query';
			break;
		}

		return $this->$hash->set($name, $value);
	}
865785
public final function header(string $name, string $value = null)
    {
        return ($value === null) ? $this->getHeader($name) : $this->setHeader($name, $value);
    }
818455
public function withHeader($name, $value): self
    {
        $this->assertHeaderName($name);

        $clone = clone $this;
        $clone->headers->set($name, $value);

        if ($clone->getStatusCode() === 200 && strtolower($name) === 'location') {
            $clone = $clone->withStatus(302);
        }

        return $clone;
    }
351310
public function withHeader($name, $value)
    {
        $new = clone $this;
        $name = $this->normalizeHeaderName($name);
        $new->_environment[$name] = $value;

        return $new;
    }
194977
public function bcc($address, $name = null, $override = false)
    {
        if ($override) {
            $this->swift->setBcc($address, $name);

            return $this;
        }

        return $this->addAddresses($address, $name, 'Bcc');
    }
1093011
public function withAddedHeader($name, $value)
    {
        $instance = clone $this;
        $instance->headers->add($name, $value);
        return $instance;
    }
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;
    }
686808
public function addHeader($name, $value = null)
    {
        if (is_numeric($name)) {
            $status = $this->getStatus($name);
            if (!empty($status)) {
                $this->headers[] = "{$_SERVER['SERVER_PROTOCOL']} $name $status";
            }
        } elseif (isset($value)) {
            $this->headers[] = "$name: $value";
        }

        return $this;
    }
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;
    }