protected function exec()
    {
        //get response output and info
        $response = curl_exec($this->curl);
        $info     = curl_getinfo($this->curl);

        //if there is a curl error throw Exception
        if (curl_error($this->curl)) {
            //throw error
            throw new PipedriveHttpError('API call failed: ' . curl_error($this->curl));
        }
        //decode output
        $result = json_decode($response, true);

        //if http error throw exception
        if (floor($info['http_code'] / 100) >= 4) {
            //throw error
            throw new PipedriveApiError('API HTTP Error ' . $info['http_code'] . '. Message ' . $result['error']);
        }
        // return output
        return $result;
    }
protected function exec()
    {
        //get response output and info
        $response = curl_exec($this->curl);
        $info     = curl_getinfo($this->curl);

        //if there is a curl error throw Exception
        if (curl_error($this->curl)) {
            //throw error
            throw new PipedriveHttpError('API call failed: ' . curl_error($this->curl));
        }
        //decode output
        $result = json_decode($response, true);

        //if http error throw exception
        if (floor($info['http_code'] / 100) >= 4) {
            //throw error
            throw new PipedriveApiError('API HTTP Error ' . $info['http_code'] . '. Message ' . $result['error']);
        }
        // return output
        return $result;
    }
protected function exec ( ) { //get response output and info $ response = curl_exec ( $ this -> curl ) ; $ info = curl_getinfo ( $ this -> curl ) ; //if there is a curl error throw Exception if ( curl_error ( $ this -> curl ) ) { //throw error throw new PipedriveHttpError ( 'API call failed: ' . curl_error ( $ this -> curl ) ) ; } //decode output $ result = json_decode ( $ response , true ) ; //if http error throw exception if ( floor ( $ info [ 'http_code' ] / 100 ) >= 4 ) { //throw error throw new PipedriveApiError ( 'API HTTP Error ' . $ info [ 'http_code' ] . '. Message ' . $ result [ 'error' ] ) ; } // return output return $ result ; }
Execute current cURL session

@return array decoded json ouput
Execute current cURL session