Sets the headers from the given array.

@param string[]|string[][] $headers
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;
        }
    }
272702
protected function setHeaders(array $headers)
    {
        $this->headerNames = $this->headerValues = [];

        foreach ($headers as $name => $value) {
            if (!is_array($value)) {
                $value = [$value];
            }

            if (in_array(false, array_map('is_string', $value))) {
                throw new InvalidArgumentException('Header value must be string or array of string.');
            }

            $lowerName = strtolower($name);
            $this->headerNames[$lowerName] = $name;
            $this->headerValues[$lowerName] = $value;
        }
    }
451356
public function parseHeaders(array $headers)
    {
        $parsed = [];

        foreach ($headers as $key => $val)
        {
            $parsed[] = $key . ': ' . $val;
        }

        return $parsed;
    }
131100
public function removeHeaders($keys)
    {
        $key_array = (array) $keys;
        foreach ($key_array as $key) {
            unset($this->headers[$key]);
        }
    }
351129
public function setAuthHeader($params)
    {
        if (is_array($params)) {
            $this->authHeader = $this->toHeader($params);
        } else {
            if (strpos($params, 'Authorization: ') !== false) {
                $params = str_replace('Authorization: ', '', $params);
            }

            $this->authHeader = $params;
        }
    }
1291631
protected function setHeaders(array $headers)
    {
        foreach ($headers as $header) {

            if (isset($header['name']) && isset($header['value'])) {
                $this->headers[$header['name']] = $header['value'];
            }
        }

        return $this;
    }
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;
    }
1332314
def set_headers(self, headers):
        

        logger.debug("Setting headers: " + str(headers))
        self.headers = headers
1108527
public function addCorsHeaders($headers)
    {
        if (empty($headers) === false) {
            foreach ($headers as $header => $value) {
                app()->response->setHeader($header, $value);
            }
        }
    }
1330499
function setHeaders($headers) {
      if (is_array($headers)) {
        reset($headers);
        while (list($name, $value) = each($headers)) {
          $this->requestHeaders[$name] = $value;
        }
      }
    }
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;
    }
1300248
function setHeaders($headers){
		$this->debug("setHeaders headers=");
		$this->appendDebug($this->varDump($headers));
		$this->requestHeaders = $headers;
	}
968593
public function setExposedHeaders(array $headers): self
    {
        // Optional: from #7.1.1 'simple response headers' will be available in any case so it does not
        // make sense to include those headers to exposed.
        $filtered = [];
        foreach ($headers as $header) {
            if (\in_array(\strtolower($header), static::SIMPLE_LC_RESPONSE_HEADERS) === false) {
                $filtered[] = $header;
            }
        }

        $this->exposedHeadersList = \implode(', ', $filtered);

        return $this;
    }
70985
public function parseHeaders(array $headers)
    {
        foreach ($headers as $key => $value) {
            if (strpos($key, 'HTTP_') !== false) {
                $newKey                 = str_replace(['http_', '_'], ['', '-'],
                    mb_strtolower($key));
                $this->headers[$newKey] = $value;
            }
        }
        return $this->headers;
    }
846820
public function setHeaders(TableNode $headers)
    {
        foreach ($headers->getRowsHash() as $name => $value) {
            $this->setHeader($name, $value);
        }
    }
256079
public function setHeaders($headers) {
    $this->allHeaders = array();

    foreach ($headers as $name => $value) {
      if (strpos($name, Container::METADATA_HEADER_PREFIX) !== 0) {
        $this->allHeaders[$name] = $value;
      }
    }

    return $this;
  }
480058
public function setAccessControlAllowHeaders($headers)
    {
        if (is_array($headers)) {
            $headers = implode(', ', $headers);
        }

        $this->setHeader('Access-Control-Allow-Headers', (string) $headers);

        return $this;
    }