为什么在CURLOPT_INTERFACE中使用指定ip进行CURL空响应?

时间:2019-03-28 05:25:03

标签: php curl

当将CURLOPT_INTERFACE与指定ip一起使用时,为什么Google api拒绝curl请求。从api网址获取空响应。

$url = "https://www.googleapis.com/youtube/v3...";  
$ch = curl_init();
curl_setopt($ch, CURLOPT_INTERFACE, "xx.xxx.xx.xx");
curl_setopt($ch, CURLOPT_URL, $url);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

请帮助我。

0 个答案:

没有答案
相关问题