function CurlPost($url, $data)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);
curl_setopt($curl, CURLOPT_URL, $url);
if(!empty($data))
{
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
}
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
function CurlGet($url)
{
return CurlPost($url, "");
}
请求地址是:https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN 刚开始是在5秒之内,微信小程序中客服的问题。后来发出请求到接收微信ticket越来越慢,最长可能耗时1分钟多甚至可能会不返回参数,不知道是不是curl的问题
本文网址:http://www.91bianli.com/weixinxiaochengxu/54779.html