Closed ghost closed 6 years ago
<?php $client = new GuzzleClient(['base_uri' => 'https://raw.githubusercontent.com']); $body = $client->request('get', '/FriendsOfPHP/Goutte/master/box.json')->getBody()->getContents();
Works as expected, but
<?php $client = new Client(); $client->setClient(new GuzzleClient(['base_uri' => 'https://raw.githubusercontent.com'])); $body = $client->request('get', '/FriendsOfPHP/Goutte/master/box.json')->html();
doesn't work.
{ "output": "goutte.phar", "chmod": "0755", "compactors": [ "Herrera\\Box\\Compactor\\Php" ], "extract": false, "files": [ "LICENSE", "Goutte/Client.php" ], "finder": [ { "name": ["*.php", "*.pem*"], "exclude": ["Tests", "tests"], "in": "vendor" } ], "stub": "Goutte/Resources/phar-stub.php", "web": false }
<head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr> <center>nginx/1.10.3 (Ubuntu)</center> </body>
If use var_dump on the object, we can see this:
var_dump
protected 'uri' => string 'http://localhost/FriendsOfPHP/Goutte/master/box.json'
Any updates on this?
How to reproduce
Works as expected, but
doesn't work.
Expected
Actual
If use
var_dump
on the object, we can see this: