diff --git a/src/WordpressClient.php b/src/WordpressClient.php index 3993117..a7e10ef 100644 --- a/src/WordpressClient.php +++ b/src/WordpressClient.php @@ -863,14 +863,7 @@ private function _sendRequest($method, $params) foreach ($callbacks as $callback) { $callback($event); } - if (function_exists('curl_init')) - { - $body = $this->_requestWithCurl(); - } - else - { - $body = $this->_requestWithFile(); - } + $body = $this->performRequest(); $response = xmlrpc_decode($body, 'UTF-8'); if (is_array($response) && xmlrpc_is_fault($response)) { @@ -904,6 +897,18 @@ private function _setXmlrpcType(&$array) } } + protected function performRequest() + { + if (function_exists('curl_init')) + { + return $this->_requestWithCurl(); + } + else + { + return $this->_requestWithFile(); + } + } + private function _requestWithCurl() { $ch = curl_init($this->_endPoint);