【发布时间】:2015-02-13 02:07:06
【问题描述】:
我正在尝试通过 laravel 中的 http 请求获取 github 用户详细信息。
我为此使用包 Guzzle。 我的控制器如下所示,
public function apiProject()
{
$client = new \GuzzleHttp\Client();
$response = $client->get('http://api.github.com/users/jishadp369');
dd($response->getBody());
}
当我在浏览器中指向路线时,浏览器会加载一些时间并抛出类似
的错误cURL error 7: Failed connect to api.github.com:80; Connection timed out
我在终端中尝试使用 curl 我可以很好地得到结果。
在 Firebug->Net 中:它显示 500 Internal server error,
我该如何解决这个问题。 ?
谢谢
【问题讨论】:
标签: curl laravel-4 github-api guzzle