public function send($destination, $text)
    {
        /** @var Response $response */
        $response = $this->browser->post('http://distext.wavy.be/api/sms', array(
            'X-Auth-Token' => $this->apiKey,
        ), json_encode([
            'destination' => $destination,
            'text' => $text,
        ]));
        
        if(!$response->isSuccessful()) {
            $message = $response->getStatusCode() === 401 ? 'Invalid API key' : $response->getReasonPhrase();
            throw new \Exception($message);
        }
    }
public function send($destination, $text)
    {
        /** @var Response $response */
        $response = $this->browser->post('http://distext.wavy.be/api/sms', array(
            'X-Auth-Token' => $this->apiKey,
        ), json_encode([
            'destination' => $destination,
            'text' => $text,
        ]));
        
        if(!$response->isSuccessful()) {
            $message = $response->getStatusCode() === 401 ? 'Invalid API key' : $response->getReasonPhrase();
            throw new \Exception($message);
        }
    }
public function send ( $ destination , $ text ) { /** @var Response $response */ $ response = $ this -> browser -> post ( 'http://distext.wavy.be/api/sms' , array ( 'X-Auth-Token' => $ this -> apiKey , ) , json_encode ( [ 'destination' => $ destination , 'text' => $ text , ] ) ) ; if ( ! $ response -> isSuccessful ( ) ) { $ message = $ response -> getStatusCode ( ) === 401 ? 'Invalid API key' : $ response -> getReasonPhrase ( ) ; throw new \ Exception ( $ message ) ; } }
Send a text message
@param string $destination
@param string $text
@throws \Exception
Send a text message