首页 > 其他 > 详细

短信平台接口调用方法参考

时间:2018-01-12 10:15:52      阅读:208      评论:0      收藏:0      [点我收藏+]
http请求:
<?php $urlsend="http://xxx.com/api/MsgSend.asmx/sendMes"; $token=array("userCode"=>"用户名","userPass"=>"密码","DesNo"=>"手机号","Msg"=>"短信内容【签名】","Channel"=>"通道号"); echo http($urlsend,$token,"GET"); //get请求 echo http($urlsend,$token,"POST"); //post请求 function http($url,$param,$action="GET"){ $ch=curl_init(); $config=array(CURLOPT_RETURNTRANSFER=>true,CURLOPT_URL=>$url); if($action=="POST"){ $config[CURLOPT_POST]=true; } $config[CURLOPT_POSTFIELDS]=http_build_query($param); curl_setopt_array($ch,$config); $result=curl_exec($ch); curl_close($ch); return $result; } ?>
webService请求:
<?php
    //此处仅示例发送短信,其他可类推
    header("Content-type: text/html; charset=utf-8");
    $client = new SoapClient("http://xxx.com/api/MsgSend.asmx?WSDL");
    $param = array("userCode"=>"用户名","userPass"=>"密码","DesNo"=>"手机号","Msg"=>"短信内容【签名】","Channel"=>"通道号");
    $p = $client->sendMes($param);
    print_r($p);
    ?>

短信平台接口调用方法参考

原文:https://www.cnblogs.com/zhq--blog/p/8274199.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!