public function Header::__construct

Construct a new header object

Parameters

string $header Name of the header:

array $values Values of the header:

string $glue Glue used to combine multiple values into a string:

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Header.php, line 25

Class

Header
Represents a header and all of the values stored by that header

Namespace

Guzzle\Http\Message

Code

public function __construct($header, $values = array(), $glue = ', ') {
  $this->header = $header;
  $this->glue = $glue;
  if (null !== $values) {
    foreach ((array) $values as $key => $value) {
      if (is_numeric($key)) {
        $key = $header;
      }
      if ($value === null) {
        $this
          ->add($value, $key);
      }
      else {
        foreach ((array) $value as $v) {
          $this
            ->add($v, $key);
        }
      }
    }
  }
}