You are here

public function Webhook::setHeaders in Webhooks 8

Set the headers.

Parameters

array $headers: A headers array.

Return value

Webhook The webhook.

1 call to Webhook::setHeaders()
Webhook::__construct in src/Webhook.php
Webhook constructor.

File

src/Webhook.php, line 114

Class

Webhook
Class Webhook .

Namespace

Drupal\webhooks

Code

public function setHeaders(array $headers) {

  // RequestStack returns the Header-Value as an array.
  foreach ($headers as $key => $value) {
    if (is_array($value)) {
      $headers[$key] = reset($value);
    }
  }
  $this->headers = $headers;
  return $this;
}