You are here

protected function SettingsForm::setRepublish in Siteimprove 8

Enable Siteimprove's Republish feature on Siteimprove server.

Parameters

string $username: API username.

string $key: API key.

1 call to SettingsForm::setRepublish()
SettingsForm::buildForm in src/Form/SettingsForm.php
Form constructor.

File

src/Form/SettingsForm.php, line 321

Class

SettingsForm
Siteimprove settings.

Namespace

Drupal\siteimprove\Form

Code

protected function setRepublish($username, $key) {
  $url = 'https://api.siteimprove.com/v2/settings/content_checking';
  $res = $this->httpClient
    ->request('POST', $url, [
    'auth' => [
      $username,
      $key,
    ],
    'headers' => [
      'Accept' => 'application/json',
    ],
    'http_errors' => FALSE,
  ]);
}