使用Infobip sms网关时遇到问题。当我执行此代码时,我不知道下面的代码有一个错误叫做没有找到HttpRequest类。任何人请帮助我。
<?php
$request = new HttpRequest();
$request->setUrl('https://api.infobip.com/sms/1/text/single');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from":"InfoSMS",
"to":"41793026727",
"text":"Test SMS."
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}