protected function get_response() {
        global $CFG;
        require_once($CFG->libdir.'/filelib.php');

        $curl = new \curl(array('proxy' => true));
        $response = $curl->post($this->prepare_request_url(), $this->prepare_request_params(), $this->prepare_request_options());
        $curlerrno = $curl->get_errno();
        if (!empty($curlerrno)) {
            throw new checker_exception('err_response_curl', 'cURL error '.$curlerrno.': '.$curl->error);
        }
        $curlinfo = $curl->get_info();
        if ($curlinfo['http_code'] != 200) {
            throw new checker_exception('err_response_http_code', $curlinfo['http_code']);
        }
        return $response;
    }
protected function get_response() {
        global $CFG;
        require_once($CFG->libdir.'/filelib.php');

        $curl = new \curl(array('proxy' => true));
        $response = $curl->post($this->prepare_request_url(), $this->prepare_request_params(), $this->prepare_request_options());
        $curlerrno = $curl->get_errno();
        if (!empty($curlerrno)) {
            throw new checker_exception('err_response_curl', 'cURL error '.$curlerrno.': '.$curl->error);
        }
        $curlinfo = $curl->get_info();
        if ($curlinfo['http_code'] != 200) {
            throw new checker_exception('err_response_http_code', $curlinfo['http_code']);
        }
        return $response;
    }
protected function get_response ( ) { global $ CFG ; require_once ( $ CFG -> libdir . '/filelib.php' ) ; $ curl = new \ curl ( array ( 'proxy' => true ) ) ; $ response = $ curl -> post ( $ this -> prepare_request_url ( ) , $ this -> prepare_request_params ( ) , $ this -> prepare_request_options ( ) ) ; $ curlerrno = $ curl -> get_errno ( ) ; if ( ! empty ( $ curlerrno ) ) { throw new checker_exception ( 'err_response_curl' , 'cURL error ' . $ curlerrno . ': ' . $ curl -> error ) ; } $ curlinfo = $ curl -> get_info ( ) ; if ( $ curlinfo [ 'http_code' ] != 200 ) { throw new checker_exception ( 'err_response_http_code' , $ curlinfo [ 'http_code' ] ) ; } return $ response ; }
Makes cURL request to get data from the remote site

@return string raw request result
@throws checker_exception
Makes cURL request to get data from the remote site