2017-05-05 65 views
0

一个简单的请求工作正常。这是代码片段。连接尝试失败,因为连接方在cakephp中一段时间​​后没有正确响应2.6.7

$link = 'http://www.api2apipro.live/' . 'rest_payments.json'; 

    $httpSocket = new HttpSocket(); 

    $response = $httpSocket->post($link, $this->request->data); 

这里$this->request->data是一个数组。现在它显示以下错误:

A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. 

我找到了原因。我无法浏览http://www.api2apipro.live从我的IP意味着我不允许从我的本地服务器访问此URL。但是有没有任何技巧来语法解锁这个访问?

回答

0

如果远程服务器不允许您的IP访问内容,则没有其他选择,只能从允许的IP中运行脚本,或获得授权的本地IP。

相关问题