MangoPay/Libraries/HttpCurl.php
private function RunRequest()
    {
        $result = curl_exec($this->_curlHandle);
        if ($result === false && curl_errno($this->_curlHandle) != 0) {
            $this->logger->error("cURL error: " . curl_error($this->_curlHandle));
            throw new Exception('cURL error: ' . curl_error($this->_curlHandle));
        }

        $response = new HttpResponse();
        $response->ResponseCode = (int) curl_getinfo($this->_curlHandle, CURLINFO_HTTP_CODE);

        curl_close($this->_curlHandle);

        $explode = explode("\r\n\r\n", $result);

        // multiple query (follow redirect) take only the last request
        $explode = array_slice($explode, sizeof($explode) - 2, 2);

        $response->Headers = explode("\n", implode($explode));
        $response->Body = array_pop($explode);

        return $response;
    }
private function RunRequest()
    {
        $result = curl_exec($this->_curlHandle);
        if ($result === false && curl_errno($this->_curlHandle) != 0) {
            $this->logger->error("cURL error: " . curl_error($this->_curlHandle));
            throw new Exception('cURL error: ' . curl_error($this->_curlHandle));
        }

        $response = new HttpResponse();
        $response->ResponseCode = (int) curl_getinfo($this->_curlHandle, CURLINFO_HTTP_CODE);

        curl_close($this->_curlHandle);

        $explode = explode("\r\n\r\n", $result);

        // multiple query (follow redirect) take only the last request
        $explode = array_slice($explode, sizeof($explode) - 2, 2);

        $response->Headers = explode("\n", implode($explode));
        $response->Body = array_pop($explode);

        return $response;
    }
private function RunRequest ( ) { $ result = curl_exec ( $ this -> _curlHandle ) ; if ( $ result === false && curl_errno ( $ this -> _curlHandle ) != 0 ) { $ this -> logger -> error ( "cURL error: " . curl_error ( $ this -> _curlHandle ) ) ; throw new Exception ( 'cURL error: ' . curl_error ( $ this -> _curlHandle ) ) ; } $ response = new HttpResponse ( ) ; $ response -> ResponseCode = ( int ) curl_getinfo ( $ this -> _curlHandle , CURLINFO_HTTP_CODE ) ; curl_close ( $ this -> _curlHandle ) ; $ explode = explode ( "\r\n\r\n" , $ result ) ; // multiple query (follow redirect) take only the last request $ explode = array_slice ( $ explode , sizeof ( $ explode ) - 2 , 2 ) ; $ response -> Headers = explode ( "\n" , implode ( $ explode ) ) ; $ response -> Body = array_pop ( $ explode ) ; return $ response ; }
Execute request and check response
@return HttpResponse Response data
@throws Exception If cURL has error
Execute request and check response