http协议php短信接口调用代码示例:
1.提交方式与编码
http请求都应以POST形式提交,编码为UTF-8
2.部分核心代码示例如下final public static function sendSms($user,$password,$content,$mobiles){
$client = new HttpClient(self::HOST);
$client->setDebug(true);
if(! $client->post('/sdk/send' , array(
'accName' => $user,
'accPwd' => strtoupper(md5($password)),
'content' => mb_convert+encoding($content,'UTF-8',UTF-8),
'aimcodes' => $mobiles,
'dataType' =>"xml"
))){
return '-10000';
}else{
return self::_replyResult($client->getContent);
}
}