You are here

public function PardotClient::retry in Pardot Integration 2.x

Retry the original operation with fresh token.

Parameters

$url: The original url to post to again.

$request_data: The original request data to try again.

Return value

mixed Return the function call with the retry flag.

Overrides PardotClientInterface::retry

1 call to PardotClient::retry()
PardotClient::executePardotOperation in src/Service/PardotClient.php
Execute the Pardot API operation.

File

src/Service/PardotClient.php, line 173

Class

PardotClient
Provides methods to execute Pardot API operations.

Namespace

Drupal\pardot\Service

Code

public function retry($url, $request_data) {
  $token = $this
    ->authenticate(TRUE);
  if ($token) {
    $request_data['headers']['Authorization'] = "Bearer {$token}";
    $request_data['form_params']['api_key'] = $token;
    return $this
      ->executePardotOperation($url, $request_data, TRUE);
  }
}