$curl = curl_init(); /* curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_REFERER => $url, CURLOPT_AUTOREFERER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_CONNECTTIMEOUT => 1, CURLOPT_TIMEOUT => 30, CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36' ) ); */ curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl,CURLOPT_RETURNTRANSFER,1); //curl_setopt($curl, CURLOPT_HTTPHEADER, array('Expect:')); //curl_setopt($curl, CURLOPT_HEADER, true); $res = curl_exec($curl);
没有办法获取accessToken真无奈,难道每次都要通过接口调试工具吗?请问老师正确的打开办法?
返回结果:
200 OK
Connection: close
Date: Mon, 13 Jun 2016 03:25:04 GMT
Content-Type: application/json; encoding=utf-8
Content-Length: 175
{
"access_token": "####",
"expires_in": 7198}
提示:
Request successful
微笑de迪妮莎