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);
        ?>
  • 相关阅读:
    有用网站
    html5页面布局总结
    video和audio支持格式
    关于浏览器缓冲
    java常见面试题汇总
    jvm常用相关参数
    规律字符串拼接
    线程基础知识
    Kafka学习
    Redis学习
  • 原文地址:https://www.cnblogs.com/zhq--blog/p/8274199.html
Copyright © 2011-2022 走看看