赞
踩
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);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。