//第一种 $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);