Set a http header for the request

@param string $header
@param string $value
166029
public function setHeader($header, $value)
    {
        if (is_array($value)) {
            throw new \Exception('Could not set the header: '.$header);
        }
        $this->headers[$header] = $value;
    }
490744
final public function withHeader(string $name, string $value) : HttpException
    {
        $this->headers[$name] = $value;

        return $this;
    }
1204556
public function addHeader(string $key, string $value): Response
    {
        $this->headers->add($key, $value);
        return $this;
    }
1148472
public function withAddedHeader($header, $value)
    {
        // Follow a different procedure if the given header isn't set yet at all.
        if (!$this->hasHeader($header)) {
            return $this->withHeader($header, $value);
        }

        // Normalize the header name.
        $name   = strtolower($header);
        $header = $this->headerNames[$name];

        // Create a clone and append the value to the specified header's values.
        $new = clone $this;
        $new->headers[$header] = array_merge($this->headers[$header], (array) $value);

        return $new;
    }
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;
    }
157419
public function setHeader($header, $value = NULL)
	{
		if($header instanceof HttpHeaderInterface)
		{
			$this->headers[strtolower($header->getFieldName())] = [[(string)$header->getFieldName(), trim($header->getFieldValue())]];
		}
		else
		{
			$this->headers[strtolower($header)] = [[(string)$header, trim($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;
    }
343425
public void put(HttpHeader header, String value) {
        if (value == null)
            remove(header);
        else
            put(new HttpField(header, value));
    }
309626
public function withAddedHeader($header, $value)
    {
        $new = $this->psrRequest->withAddedHeader($header, $value);
        return new self($new, $this->originalRequest);
    }
108729
public function addGenericHeader($header, $value)
    {
        $this->_headers[] = sprintf(
            '%s: %s',
            (string) $header,
            (string) $value
        );
        return $this;
    }
1210265
public function addHttpHeader($http_header, $value)
    {
        $field = EnumRequestOption::HTTP_HEADERS;
        $http_headers = isset($this->options[$field]) ? $this->options[$field] : [];

        foreach($http_headers as $key => $header){
            if (strpos($header, $http_header) === 0){
                $http_headers[$key] = "$http_header: $value\r\n";
                return;
            }
        }

        $http_headers[$http_header] = $value;
        $this->options[$field] = $http_headers;
    }
728508
public function addHeader(string $name, string $value): Response
    {
        $this->headers->add($name, $value);
        return $this;
    }
464525
public function addGlobalHeader($key, $value = null)
    {
        if ($key instanceof Header) {
            $header = $key;
            $this->headers[$header->getKey()]
                = $header->getValue();
            return;
        }
        $this->headers[$key] = (string)$value;
    }
1273283
@NotNull
	public HttpResponse withHeader(@NotNull HttpHeader header, @NotNull String value) {
		addHeader(header, value);
		return this;
	}
1189221
public function setHeader($header, $value = null)
    {
        if (is_string($header)) {
            $this->headers[$header] = $value;
        }

        return $this;
    }
304099
public function header($header = null, $value = null) {
        if ($header === null) {
            $this->headers = [];
        } else if ($value === null) {
            unset($this->headers[ $header ]);
        } else {
            $this->headers[ $header ] = $header . ': ' . $value;
        }

        return $this;
    }
1064684
public static void header(Header header, String value) {
        Objects.requireNonNull(header, Required.HEADER.toString());
        
        Map<Header, String> newHeaders = new EnumMap<>(headers);
        newHeaders.put(header, value);
        headers = newHeaders;
    }