You are here

public function JsResponse::setHeader in JS Callback Handler 8.3

Sets an header by name, explicitly.

Parameters

string $name: The name of the header.

string|array $value: The value or an array of values to set.

bool $replace: Flag indicating whether to replace the value or not, TRUE by default.

Return value

$this

File

src/JsResponse.php, line 224

Class

JsResponse
JsResponse.

Namespace

Drupal\js

Code

public function setHeader($name, $value, $replace = TRUE) {
  $this->headers
    ->set($name, $value, $replace);
  return $this;
}