New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GuzzleHttp Client `base_uri` option is being ignored #328

ghost opened this Issue Nov 30, 2017 · 1 comment


None yet
1 participant

ghost commented Nov 30, 2017

How to reproduce


$client = new GuzzleClient(['base_uri' => '']);
$body = $client->request('get', '/FriendsOfPHP/Goutte/master/box.json')->getBody()->getContents();

Works as expected, but


$client = new Client();
$client->setClient(new GuzzleClient(['base_uri' => '']));
$body = $client->request('get', '/FriendsOfPHP/Goutte/master/box.json')->html();

doesn't work.


    "output": "goutte.phar",
    "chmod": "0755",
    "compactors": [
    "extract": false,
    "files": [
    "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>
<center>nginx/1.10.3 (Ubuntu)</center>

If use var_dump on the object, we can see this:

protected 'uri' => string 'http://localhost/FriendsOfPHP/Goutte/master/box.json'

This comment has been minimized.

Show comment
Hide comment

trinvh May 14, 2018

Any updates on this?

trinvh commented May 14, 2018

Any updates on this?

@fabpot fabpot closed this in #349 Jun 29, 2018

fabpot added a commit that referenced this issue Jun 29, 2018

feature #349 Support setting Guzzle's "base_uri" option (dunglas)
This PR was merged into the 3.2-dev branch.


Support setting Guzzle's "base_uri" option

Allow to set a base URI. Fix #328.


71dc217 Support setting Guzzle's "base_uri" option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment