public function request($method, $uri, array $headers = [], $body = null)
{
try {
$response = $this->client->send($method, self::API_URL . $uri, array_merge(['Content-Type' => 'application/json'], $headers), $body);
return json_decode($response->getBody(), true);
} catch (\Throwable $t) {
throw new OneSignalException($t->getMessage());
} catch (\Exception $e) {
throw new OneSignalException($e->getMessage());
}
}