diff --git a/composer.json b/composer.json index 1be4d81..4189147 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,6 @@ }, "require": { "php": ">=5.4.0", - "guzzlehttp/guzzle": "~5.1" + "guzzlehttp/guzzle": "~6.0" } } diff --git a/src/Client.php b/src/Client.php index 9bcdb84..a4f4fa6 100644 --- a/src/Client.php +++ b/src/Client.php @@ -32,11 +32,10 @@ private function getClient() { if (null === $this->client) { $this->client = new \GuzzleHttp\Client([ - 'defaults' => [ - 'headers' => [ - 'Authorization' => $this->token - ] - ] + 'base_uri' => 'https://api.pexels.com/v1/', + 'headers' => [ + 'Authorization' => $this->token + ] ]); } @@ -52,10 +51,10 @@ private function getClient() */ public function search($query, $size = 15, $page = 1) { - return $this->getClient()->get('http://api.pexels.com/v1/search?'.http_build_query([ + return $this->getClient()->get('search?'.http_build_query([ 'query' => $query, 'per_page' => $size, 'page' => $page - ])); + ])); } }