You are here

public function JsResponse::getHeader in JS Callback Handler 8.3

Retrieves a header value by name.

Parameters

string $name: The header to retrieve.

mixed $default: The default value if header is not set.

bool $first: Flag indicating whether to return only the first value or all values for the header, TRUE by default.

Return value

string|array The first header value if $first is true, an array of values otherwise.

File

src/JsResponse.php, line 97

Class

JsResponse
JsResponse.

Namespace

Drupal\js

Code

public function getHeader($name, $default = NULL, $first = TRUE) {
  return $this->headers
    ->get($name, $default, $first);
}