src/Builder.php
public function httpGetRequest($url)
    {
        // Check for cache hit.
        if ($this->useCache()) {
            $cache = $this->getCache();

            if ($response = $cache->get($url)) {
                return $response;
            }
        }

        if (empty($this->client)) {
            $this->client = new Client(['verify' => false]);
        }

        $this->response = $this->client->request(
            'GET',
            $url,
            ['headers' => $this->getHeaders()]
        );
        $response = json_decode($this->response->getBody());

        if (!empty($cache)) {
            $cache->put($url, $response, $this->getCacheTtl());
        }

        return $response;
    }
public function httpGetRequest($url)
    {
        // Check for cache hit.
        if ($this->useCache()) {
            $cache = $this->getCache();

            if ($response = $cache->get($url)) {
                return $response;
            }
        }

        if (empty($this->client)) {
            $this->client = new Client(['verify' => false]);
        }

        $this->response = $this->client->request(
            'GET',
            $url,
            ['headers' => $this->getHeaders()]
        );
        $response = json_decode($this->response->getBody());

        if (!empty($cache)) {
            $cache->put($url, $response, $this->getCacheTtl());
        }

        return $response;
    }
public function httpGetRequest ( $ url ) { // Check for cache hit. if ( $ this -> useCache ( ) ) { $ cache = $ this -> getCache ( ) ; if ( $ response = $ cache -> get ( $ url ) ) { return $ response ; } } if ( empty ( $ this -> client ) ) { $ this -> client = new Client ( [ 'verify' => false ] ) ; } $ this -> response = $ this -> client -> request ( 'GET' , $ url , [ 'headers' => $ this -> getHeaders ( ) ] ) ; $ response = json_decode ( $ this -> response -> getBody ( ) ) ; if ( ! empty ( $ cache ) ) { $ cache -> put ( $ url , $ response , $ this -> getCacheTtl ( ) ) ; } return $ response ; }
Make a GET request and respond with json decoded to array.

@param string $url
@return array
Make a GET request and respond with json decoded to array .