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);
        ?>
  • 相关阅读:
    半同步/半反应堆线程池
    各种排序算法总结
    【面试题】求连续子数组的最大和(三种解法)
    数据结构查找、插入、删除时间复杂度
    红黑树
    opencv 图像基本操作
    plotroc.m
    roc.m
    perfcurve.m
    637. Average of Levels in Binary Tree
  • 原文地址:https://www.cnblogs.com/zhq--blog/p/8274199.html
Copyright © 2011-2022 走看看