protected function makeGetRequest($endpoint, array $params) {
        // Constructs get url
        // e.g:
        // endpoint = 'ip-address/report'
        //
        // params => array(
        //                'ip'       => '192.168.2.1',
        //                'apikey'   => 'supersecureapikey'
        //            )
        //
        // It maps to:
        // https://www.virustotal.com/vtapi/v2/ip-address/report?ip=192.168.2.1&apikey=supersecureapikey
        try {
            $url = self::API_ENDPOINT . $endpoint . '?'. http_build_query($params);
            $response = $this->_client->get($url);
            $this->validateResponse($response->getStatusCode());
            return $response;
        } catch(ClientException $e) {
            $this->validateResponse($e->getResponse()->getStatusCode());
        }
    }
protected function makeGetRequest($endpoint, array $params) {
        // Constructs get url
        // e.g:
        // endpoint = 'ip-address/report'
        //
        // params => array(
        //                'ip'       => '192.168.2.1',
        //                'apikey'   => 'supersecureapikey'
        //            )
        //
        // It maps to:
        // https://www.virustotal.com/vtapi/v2/ip-address/report?ip=192.168.2.1&apikey=supersecureapikey
        try {
            $url = self::API_ENDPOINT . $endpoint . '?'. http_build_query($params);
            $response = $this->_client->get($url);
            $this->validateResponse($response->getStatusCode());
            return $response;
        } catch(ClientException $e) {
            $this->validateResponse($e->getResponse()->getStatusCode());
        }
    }
protected function makeGetRequest ( $ endpoint , array $ params ) { // Constructs get url // e.g: // endpoint = 'ip-address/report' // // params => array( //                'ip'       => '192.168.2.1', //                'apikey'   => 'supersecureapikey' //            ) // // It maps to: // https://www.virustotal.com/vtapi/v2/ip-address/report?ip=192.168.2.1&apikey=supersecureapikey try { $ url = self :: API_ENDPOINT . $ endpoint . '?' . http_build_query ( $ params ) ; $ response = $ this -> _client -> get ( $ url ) ; $ this -> validateResponse ( $ response -> getStatusCode ( ) ) ; return $ response ; } catch ( ClientException $ e ) { $ this -> validateResponse ( $ e -> getResponse ( ) -> getStatusCode ( ) ) ; } }
Util function to make get request
@param string          $endpoint
@param array           $params
@return (?)
@throw \VirusTotal\Exceptions\RateLimitException
@throw \VirusTotal\Exceptions\InvalidApiKeyException
Util function to make get request