zoukankan      html  css  js  c++  java
  • 短信平台接口调用方法参考

    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);
        ?>
  • 相关阅读:
    day23
    day22
    day21
    day20
    小程序 组件操作
    jmeter安装使用一
    小程序登录操作
    Django ORM DateTimeField 时间误差8小时问题
    小程序初始篇
    ADB命令
  • 原文地址:https://www.cnblogs.com/zhq--blog/p/8274199.html
Copyright © 2011-2022 走看看