//第一种
$url = "接口地址";
$data = file_get_contents($url);
dump($data);      

//第二种

$headers = [ 'Content-type: application/json;charset=UTF-8', ]
$ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);       

  

posted on 2017-11-27 10:46  mll123  阅读(153)  评论(0编辑  收藏  举报