public function get(array $query, $pluck = null)
    {
        $this->responseString = $this->client->get(self::LASTFM_API_BASEURL, [
            'http_errors' => false,
            'query' => $query,
        ]);

        $this->data = json_decode((string) $this->responseString->getBody(), true);

        if (200 !== $this->responseString->getStatusCode() || null === $this->data) {
            $this->throwResponseException();
        }

        if (isset($pluck)) {
            return $this->pluckData($this->data, $pluck);
        }

        return $this->data;
    }
public function get(array $query, $pluck = null)
    {
        $this->responseString = $this->client->get(self::LASTFM_API_BASEURL, [
            'http_errors' => false,
            'query' => $query,
        ]);

        $this->data = json_decode((string) $this->responseString->getBody(), true);

        if (200 !== $this->responseString->getStatusCode() || null === $this->data) {
            $this->throwResponseException();
        }

        if (isset($pluck)) {
            return $this->pluckData($this->data, $pluck);
        }

        return $this->data;
    }
public function get ( array $ query , $ pluck = null ) { $ this -> responseString = $ this -> client -> get ( self :: LASTFM_API_BASEURL , [ 'http_errors' => false , 'query' => $ query , ] ) ; $ this -> data = json_decode ( ( string ) $ this -> responseString -> getBody ( ) , true ) ; if ( 200 !== $ this -> responseString -> getStatusCode ( ) || null === $ this -> data ) { $ this -> throwResponseException ( ) ; } if ( isset ( $ pluck ) ) { return $ this -> pluckData ( $ this -> data , $ pluck ) ; } return $ this -> data ; }
Get, parse and validate a response from the given url.

@param array       $query
@param null|string $pluck

@return mixed
Get parse and validate a response from the given url .