You are here

private function CurlFactory::applyHeaders in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php \GuzzleHttp\Handler\CurlFactory::applyHeaders()
1 call to CurlFactory::applyHeaders()
CurlFactory::create in vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php
Creates a cURL handle resource.

File

vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php, line 284

Class

CurlFactory
Creates curl resources from a request

Namespace

GuzzleHttp\Handler

Code

private function applyHeaders(EasyHandle $easy, array &$conf) {
  foreach ($conf['_headers'] as $name => $values) {
    foreach ($values as $value) {
      $conf[CURLOPT_HTTPHEADER][] = "{$name}: {$value}";
    }
  }

  // Remove the Accept header if one was not set
  if (!$easy->request
    ->hasHeader('Accept')) {
    $conf[CURLOPT_HTTPHEADER][] = 'Accept:';
  }
}