Skip to content

Commit

Permalink
Merge pull request #19 from huntie/fix-client-query-params
Browse files Browse the repository at this point in the history
Fix query params when sending Guzzle client request
  • Loading branch information
richdynamix authored Feb 2, 2021
2 parents 936fc59 + 9500afb commit 5a30d71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ language: php
php:
- 7.1
- 7.2
- 7.3
- '7.3.24'

env:
matrix:
Expand Down
6 changes: 5 additions & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public function __construct(Guzzle $client)
public function send(RequestInterface $request, array $options = []): ResponseInterface
{
try {
return $this->client->send($request);
parse_str(parse_url($request->getUri(), PHP_URL_QUERY), $query);

return $this->client->send($request, [
'query' => array_merge($this->client->getConfig('query') ?? [], $query)
]);
}
catch (ClientException $e) {
throw WrongData::invalidValuesProvided($e->getMessage());
Expand Down

0 comments on commit 5a30d71

Please sign in to comment.