level 1
生活?要命哦
楼主
一直显示ile(https://api.weibo.com/2/users/show.json?access_token=&uid=): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request这个错误
求教,这是怎么回事呀,因为什么。
$url = $tom;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, "username:password");
$data = curl_exec($curl);
curl_close($curl);
$result = json_decode($data, true);
$access_token = $result['access_token'];
$uid = $result['uid'];
//echo $access_token;
// 继续获得用户信息 - 开始 方法一
$tom = "https://api.weibo.com/2/users/show.json?access_token=". $access_token ."&uid=" . $uid;
// 使用file方法
// $domain = 'Rinuo.com';
// $cha = 'http://panda.www.net.cn/cgi-bin/check.cgi?area_domain='.$domain ;
$data = file_get_contents($tom);
//dump($data);
$data = json_decode($data, true);
2018年03月19日 06点03分
1
求教,这是怎么回事呀,因为什么。
$url = $tom;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_POST, TRUE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERPWD, "username:password");
$data = curl_exec($curl);
curl_close($curl);
$result = json_decode($data, true);
$access_token = $result['access_token'];
$uid = $result['uid'];
//echo $access_token;
// 继续获得用户信息 - 开始 方法一
$tom = "https://api.weibo.com/2/users/show.json?access_token=". $access_token ."&uid=" . $uid;
// 使用file方法
// $domain = 'Rinuo.com';
// $cha = 'http://panda.www.net.cn/cgi-bin/check.cgi?area_domain='.$domain ;
$data = file_get_contents($tom);
//dump($data);
$data = json_decode($data, true);