Код: Выделить всё
$guzzle_http_client = new GuzzleHttp\Client([
'base_uri' => 'http://example.com/',
'query' => [
'foo' => 'bar'
],
]);
$request = new \GuzzleHttp\Psr7\Request('GET', 'foobar?boo=far');
$response = $guzzle_http_client->send($request);
Код: Выделить всё
$guzzle_http_client = new GuzzleHttp\Client([
'base_uri' => 'http://example.com/',
'query' => [
'foo' => 'bar'
],
]);
$request = new \GuzzleHttp\Psr7\Request('GET', 'foobar');
$response = $guzzle_http_client->send($request, ['query' => ['boo' => 'far']]);
Код: Выделить всё
http://example.com/foobar?foo=bar&bar=foo
Подробнее здесь: https://stackoverflow.com/questions/308 ... -using-guz