Sets the Vary header.

@param string|array $headers
@param Boolean      $replace Whether to replace the actual value of not (true by default)
@return Response
328367
public function setVary($headers, $replace = TRUE) {

		$this->headers->set('Vary', $headers, $replace);
		return $this;

	}
204843
public function sendHeader($name, $value, $replace = true)
    {
        @header($name . ': ' . trim($value), $replace);

        return $this;
    }
1268543
public static function header(
		string $header_string, bool $replace=false
	) {
		if (strpos($header_string, 'HTTP/1') !== false) {
			self::$code = explode(' ', $header_string)[1];
		} else {
			self::$head[] = $header_string;
		}
	}
182296
public function setHeader($name, $value, $replace = false)
    {
        // Add multiple headers for the reponse as array
        if (is_array($name)) {
            foreach ($name as $headerKey => $headerValue) {
                $this->headers->set($headerKey, $headerValue, $replace);
            }

            return $this;
        }

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

        return $this;
    }
966764
public function register($name, $service, $replace = false)
    {
        $this->set($name, $service, $replace);

        return $this;
    }
57089
protected function unsetHeaders(Array $headers = []) {
    foreach ($headers as $property) {
      $this->client->unsetHeader($property);
    }
  }
1149639
public function setHeader($name, $values = null, $replace = true)
    {
        if (is_array($name)) {
            foreach ($name as $key => $value) {
                $this->setHeader($key, $value);
            }
            return $this;
        }

        $values = (array)$values;
        if (true === $replace || !isset($this->headers[$name])) {
            $this->headers[$name] = $values;
        } else {
            $this->headers[$name] = array_merge($this->headers[$name], $values);
        }

        return $this;
    }
609980
protected function phpHeader(string $string, bool $replace = null, int $httpResponseCode = null) : void
    {
        header($string, $replace, $httpResponseCode);
    }
495910
public function set_header($name, $value, $replace = true)
	{
		if ($replace)
		{
			$this->headers[$name] = $value;
		}
		else
		{
			$this->headers[] = array($name, $value);
		}

		return $this;
	}
455751
public function replace(array $headers = []): void
    {
        $this->headerNames = [];
        $this->headers = [];

        $headers !== [] && $this->add($headers);

        if (!isset($this->headers['Cache-Control'])) {
            $this->set('Cache-Control', '');
        }
    }
353982
public function header(array $headers) {

        $formattedHeaders = [];

        $combinedHeaders = array_change_key_case(array_merge($this->header, $headers));

        foreach ($combinedHeaders as $key => $val)

            $formattedHeaders[] = trim(strtolower($key)) . ':' . $val;

        $this->header = $formattedHeaders;

        return $this;

    }
193774
public function withHeaders( array $headers )
	{
		foreach ( $headers as $key => $value )
		{
			$this->headers->set( $key, $value );
		}

		return $this;
	}
917241
public function replace($pattern, $replacement, $flags = 0)
    {

        if ($flags & self::REGEXP) {
            return $this->regexplace($pattern, $replacement);
        } else {
            $function = ($flags & self::CASE_SENSITIVE) ? 'str_replace' : 'str_ireplace';
            $result   = $function($pattern, $replacement, $this->getInternalValue());

        }
        $this->setInternalValue($result);

        return $this;
    }
216285
public function setHeaders(array $headers, $replace = false)
    {
        if ($replace) {
            $this->headers = $headers;
        } else {
            foreach ($headers as $key => $value) {
                $this->headers[$key] = $value;
            }
        }

        return $this;
    }
368110
public function setReplacement($replacement)
    {
        if (!is_array($replacement) && !is_string($replacement)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects replacement to be array or string; received "%s"',
                __METHOD__,
                (is_object($replacement) ? get_class($replacement) : gettype($replacement))
            ));
        }
        $this->options['replacement'] = $replacement;
        return $this;
    }
494563
protected function setHeaders(array $headers)
    {
        // Ensure this is an atomic operation, either all headers are set or none.
        $before = $this->headers;

        try {
            foreach ($headers as $name => $value) {
                $this->setHeader($name, $value);
            }
        } catch (\Throwable $e) {
            $this->headers = $before;

            throw $e;
        }
    }
501580
public function withHeader($key, $value, $replace = true)
    {
        return $this->header($key, $value, $replace);
    }