protected function execCurl($ch) {
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, true);
        $response = curl_exec($ch);

        // Split the full response into its headers and body
        $info = curl_getinfo($ch);
        $code = $info["http_code"];
        if ($response) {
            $header_size = $info["header_size"];
            $rawHeaders = substr($response, 0, $header_size);
            $status = null;
            $rawBody = substr($response, $header_size);
        } else {
            $status = $code;
            $rawHeaders = [];
            $rawBody = curl_error($ch);
        }

        $result = new HttpResponse($status, $rawHeaders, $rawBody);
        $result->setRequest($this);

        return $result;
    }
protected function execCurl($ch) {
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HEADER, true);
        $response = curl_exec($ch);

        // Split the full response into its headers and body
        $info = curl_getinfo($ch);
        $code = $info["http_code"];
        if ($response) {
            $header_size = $info["header_size"];
            $rawHeaders = substr($response, 0, $header_size);
            $status = null;
            $rawBody = substr($response, $header_size);
        } else {
            $status = $code;
            $rawHeaders = [];
            $rawBody = curl_error($ch);
        }

        $result = new HttpResponse($status, $rawHeaders, $rawBody);
        $result->setRequest($this);

        return $result;
    }
protected function execCurl ( $ ch ) { curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ ch , CURLOPT_HEADER , true ) ; $ response = curl_exec ( $ ch ) ; // Split the full response into its headers and body $ info = curl_getinfo ( $ ch ) ; $ code = $ info [ "http_code" ] ; if ( $ response ) { $ header_size = $ info [ "header_size" ] ; $ rawHeaders = substr ( $ response , 0 , $ header_size ) ; $ status = null ; $ rawBody = substr ( $ response , $ header_size ) ; } else { $ status = $ code ; $ rawHeaders = [ ] ; $ rawBody = curl_error ( $ ch ) ; } $ result = new HttpResponse ( $ status , $ rawHeaders , $ rawBody ) ; $ result -> setRequest ( $ this ) ; return $ result ; }
Execute a curl handle and return the response.

@param resource $ch The curl handle to execute.
@return HttpResponse Returns an {@link RestResponse} object with the information from the request
Execute a curl handle and return the response .