客户端返回404


GuzzleHttpClient returning 404

我已经开始使用GuzzleHttp'客户端,我有问题,从REST API获得响应,因为我得到错误404代码。我不明白,因为当我复制url从我的代码和粘贴到浏览器,我将看到json响应。你知道我做错了什么吗?

$client = new GuzzleHttp'Client();
$response = $client->get('http://login:password@url_to_api/get/some_products');
$json = $response->json();

我不认为你可以这样添加你的登录凭证。以下是正确的方法:http://guzzle.readthedocs.org/en/latest/clients.html#auth