diff --git a/src/SmsApi.php b/src/SmsApi.php index dcf3140..a4c4d49 100644 --- a/src/SmsApi.php +++ b/src/SmsApi.php @@ -161,7 +161,8 @@ public function sendMessage($to, $message, $extra_params=null) { $mobile = $this->composeBulkMobile($mobile); } try { - $this->response = $this->getClient()->get($this->getUrl($mobile,$message,$extra_params))->getBody()->getContents(); + $promise = $this->getClient()->getAsync($this->getUrl($mobile,$message,$extra_params)); + $this->response = $promise->wait()->getBody()->getContents(); } catch (RequestException $e) { if ($e->hasResponse()) { $this->response = $e->getResponseBodySummary($e->getResponse()); @@ -179,4 +180,4 @@ public function sendMessage($to, $message, $extra_params=null) { public function response(){ return $this->response; } -} \ No newline at end of file +}