You are here

public function HttpHeaderBag::__toString in RESTful 7.2

Returns the header bag as a string.

Return value

string The string representation.

File

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

Class

HttpHeaderBag

Namespace

Drupal\restful\Http

Code

public function __toString() {
  $headers = array();
  foreach ($this->values as $key => $header) {

    /* @var HttpHeader $header */
    $headers[] = $header
      ->__toString();
  }
  return implode("\r\n", $headers);
}