在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<?php class commonFunction{ function callInterfaceCommon($URL,$type,$params,$headers){ $ch = curl_init(); $timeout = 5; curl_setopt ($ch, CURLOPT_URL, $URL); //发贴地址 if($headers!=""){ curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers); }else { curl_setopt ($ch, CURLOPT_HTTPHEADER, array('Content-type: text/json')); } curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); switch ($type){ case "GET" : 调用:
$params="{user:\"admin\",pwd:\"admin\"}"; $headers=array('Content-type: text/json',"id: $ID","key:$Key"); $url=$GLOBALS["serviceUrl"]."/user"; $strResult= spClass("commonFunction")->callInterfaceCommon($url,"PUT",$params,$headers);
|
2022-08-17
2022-08-12
2022-11-06
2022-07-18
2022-08-15
请发表评论