cURL错误7无法连接Laravel中的端口80

时间:2017-08-19 11:58:43

标签: curl guzzle yahoo-api

我使用cURL在我的wordpress项目中调用了第三方yahoo / google API,其中我遇到有关cURL错误7连接失败的错误。我在whitepress中列出了yahoo API的IP。

评论代码:

$client = new \GuzzleHttp\Client(); 
$from_Currency = substr($proj->currency, 0, 3); 
$to_Currency = $req->currency; 
$encode_amount = 1; 
$get = $client->get("google.com/finance/converter?a=$encode_amount&from=$from_Currency&to=$to_Currency"); 
$get = explode("<span class=bld>",$get); 
$get = explode("</span>",$get[1]); 
$converted_currency = preg_replace("/[^0-9\.]/", null, $get[0]); 
return $converted_currency;

0 个答案:

没有答案