You are here

public function Webhook::setContentType in Webhooks 8

Set the content type.

Parameters

string $content_type: A content type string, e.g. 'application/json' or 'application/xml'.

Return value

Webhook The webhook.

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

File

src/Webhook.php, line 277

Class

Webhook
Class Webhook .

Namespace

Drupal\webhooks

Code

public function setContentType($content_type) {
  $this->contentType = $content_type;
  $this
    ->addHeaders([
    'Content-Type' => $content_type,
  ]);
  return $this;
}