Skip to content

Commit

Permalink
refactor: dotify query parameters before sending them (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
faustbrian committed Nov 11, 2020
1 parent b385604 commit efbb59e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/API/AbstractAPI.php
Expand Up @@ -17,6 +17,7 @@
use ArkEcosystem\Client\Contracts\API;
use ArkEcosystem\Client\Http\Request;
use GuzzleHttp\Client;
use Illuminate\Support\Arr;

/**
* This is the abstract resource class.
Expand Down Expand Up @@ -52,7 +53,9 @@ public function __construct(Connection $connection)
*/
protected function get(string $path, array $query = [])
{
$response = $this->connection->getHttpClient()->get($path, compact('query'));
$response = $this->connection->getHttpClient()->get($path, [
'query' => Arr::dot($query),
]);

return json_decode($response->getBody()->getContents(), true);
}
Expand Down

0 comments on commit efbb59e

Please sign in to comment.