You are here

public function HttpHeaderBag::__construct in RESTful 7.2

Constructor

Parameters

array $headers: Array of key value pairs.

File

src/Http/HttpHeaderBag.php, line 25
Contains \Drupal\restful\Http\HttpHeaderBag.

Class

HttpHeaderBag

Namespace

Drupal\restful\Http

Code

public function __construct($headers = array()) {
  foreach ($headers as $key => $value) {
    $header = HttpHeader::create($key, $value);
    $this->values[$header
      ->getId()] = $header;
  }
}