public function ClientService::sendRequest in Sparkpost email 8
Same name and namespace in other branches
- 8.2 src/ClientService.php \Drupal\sparkpost\ClientService::sendRequest()
Parameters
string $endpoint:
array $data:
string $method:
Return value
array
Throws
\SparkPost\SparkPostException
Overrides ClientServiceInterface::sendRequest
File
- src/
ClientService.php, line 72
Class
- ClientService
- Class ClientService.
Namespace
Drupal\sparkpostCode
public function sendRequest($endpoint, array $data, $method = 'GET') {
$client = $this
->getClient();
$promise = $client
->request($method, $endpoint, $data);
$response = $promise
->wait();
return $response
->getBody();
}