Add custom headers

@param array $headers The custom headers, in key=>val pairs.
@return self
357455
public function setHeaders(array $headers)
    {
        $this->headers = [];
        foreach ($headers as $name => $val) {
            $this->addHeader($name, $val);
        }
        return $this;
    }
739908
public function addHeaders(array $headers): Builder
    {
        $this->headers = array_merge($this->headers, $headers);
        $this->removePlugin(Plugin\HeaderAppendPlugin::class);
        $this->addPlugin(new Plugin\HeaderAppendPlugin($this->headers));

        return $this;
    }
649552
public function setCustomHeaders(array $headers)
    {
        foreach ($headers as $k => &$v) {
            if (strpos($v, ':') === false) {
                $v = $k.': '.$v;
            }
        }
        $this->headers = $headers;
    }
638895
public final B addHeaders(Headers<AsciiString, String, ?> headers) {
        requireNonNull(headers, "headers");
        getOrCreateHeaders().add(headers);
        return self();
    }
1098443
public function addHeaders($headers)
    {
        foreach ($headers as $name => $value) {
            $this->setHeader($name, $value);
        }
    }
10015
public function setHeaders(array $headers = [])
    {

        $this->headers = ($headers instanceof Headers) ? $headers : new Headers((array)$headers);

        return $this;

    }
1187907
public function addMultiple(array $headers): HeaderCollection
    {
        foreach ($headers as $key => $value) {
            $key = $this->getKey($key, true);
            \sndsgd\Arr::addValue($this->headers, $key, $value);
        }
        return $this;
    }
114905
protected function addHeaders()
    {
        $userHeaders = array_map(function ($key, $value) {
            // format header like this 'x-header: value'
            return sprintf('%s: %s', $key, $value);
        }, array_keys($this->payload['headers']), $this->payload['headers']);

        $headers = array_merge($this->defaultHeaders, $userHeaders);

        $this->addCurlOption(CURLOPT_HTTPHEADER, $headers);
    }
739910
protected function fixHeaders(array $headers)
    {
        $fixedHeaders = array();

        foreach ($headers as $key => $value) {
            if (is_int($key)) {
                $fixedHeaders[] = $value;
            } else {
                $fixedHeaders[] = sprintf('%s:%s', $key, $value);
            }
        }

        return $fixedHeaders;
    }
1340811
public function setAccessControlExposeHeaders($headers)
    {
        // If hraders is array, parse to string.
        if (is_array($headers)) {
            $headers = implode(', ', $headers);
        }

        // The headers not is empty, append response hraders.
        if (!empty($headers)) {
            $this->setHeader('Access-Control-Expose-Headers', (string) $headers);
        }

        return $this;
    }
584273
public function addHeader($items)
    {
        if (! is_array($items)) {
            $items = func_get_args();
        }

        $this->addElement(new Header($items));

        return $this;
    }
796346
private function addPurgeAuthHeader(array $headers)
    {
        if ($this->configResolver->hasParameter(self::INVALIDATE_TOKEN_PARAM)
            && null !== ($token = $this->configResolver->getParameter(self::INVALIDATE_TOKEN_PARAM))
        ) {
            $headers[self::INVALIDATE_TOKEN_PARAM_NAME] = $token;
        }

        return $headers;
    }
1334356
public function setHeaders(array $headers = []): Headers
    {
        $this->headers = array();

        foreach ($headers as $header => $data) {
            $this->setHeader((string)$header, (string)$data);
        }

        return $this;
    }
91329
function add($header)
    {
        // convert to object form
        if (is_string($header))
            $header = HeaderField::fromString($header);

        $this->_headers[] = $header;
        return $this;
    }
1182217
public function setHeaders($headers)
    {
        if (!empty($this->headers)) {
            $this->headers = array_merge($this->headers, $headers);
        } else {
            $this->headers = $headers;
        }
        $this->headers = array_merge($this->headers, $headers);

        if ($this->client instanceof \swoole_http_client) {
            $this->client->setHeaders($this->headers);
        }
        return $this;
    }
1176656
public function addHeaders(array $headers)
    {
        foreach ($headers as $name => $value) {
            if (is_numeric($name)) {
                $this->parseHeaderLine($value);
            } else {
                $this->addHeader($name, $value);
            }
        }
        return $this;
    }
545388
public function withHeader($header): object
    {
        if (is_array($header)) {
            foreach ($header as $value) {
                header($value);
            }
        } else {
            header($header);
        }
        return $this;
    }