public function request($url)
    {
        $curlOpts = array_replace($this->curlOpts, [CURLOPT_URL => $url]);

        $ch = curl_init();
        foreach ($curlOpts as $opt => $optVal) {
            curl_setopt($ch, $opt, $optVal);
        }

        $resp = curl_exec($ch);
        $info = (object) curl_getinfo($ch);
        curl_close($ch);

        //Check response
        $httpCode = (string) $info->http_code;
        if ($httpCode{0} != '2') {
            $msg = sprintf('HTTP Request Failed (code %s): %s', $info->http_code, $resp);
            throw new HttpException($resp, $msg, $httpCode);
        } elseif (strlen(trim($resp)) == 0) {
            throw new HttpException($resp, 'HTTP Response Empty');
        }

        return $resp;
    }
public function request($url)
    {
        $curlOpts = array_replace($this->curlOpts, [CURLOPT_URL => $url]);

        $ch = curl_init();
        foreach ($curlOpts as $opt => $optVal) {
            curl_setopt($ch, $opt, $optVal);
        }

        $resp = curl_exec($ch);
        $info = (object) curl_getinfo($ch);
        curl_close($ch);

        //Check response
        $httpCode = (string) $info->http_code;
        if ($httpCode{0} != '2') {
            $msg = sprintf('HTTP Request Failed (code %s): %s', $info->http_code, $resp);
            throw new HttpException($resp, $msg, $httpCode);
        } elseif (strlen(trim($resp)) == 0) {
            throw new HttpException($resp, 'HTTP Response Empty');
        }

        return $resp;
    }
public function request ( $ url ) { $ curlOpts = array_replace ( $ this -> curlOpts , [ CURLOPT_URL => $ url ] ) ; $ ch = curl_init ( ) ; foreach ( $ curlOpts as $ opt => $ optVal ) { curl_setopt ( $ ch , $ opt , $ optVal ) ; } $ resp = curl_exec ( $ ch ) ; $ info = ( object ) curl_getinfo ( $ ch ) ; curl_close ( $ ch ) ; //Check response $ httpCode = ( string ) $ info -> http_code ; if ( $ httpCode { 0 } != '2' ) { $ msg = sprintf ( 'HTTP Request Failed (code %s): %s' , $ info -> http_code , $ resp ) ; throw new HttpException ( $ resp , $ msg , $ httpCode ) ; } elseif ( strlen ( trim ( $ resp ) ) == 0 ) { throw new HttpException ( $ resp , 'HTTP Response Empty' ) ; } return $ resp ; }
Do CURL Request

@param  string $url The full URL
@return string The response body
Do CURL Request