/** * Send a XML-RPC request to the service (for a specific method) * * @param string $method Name of the method we want to call * @param array $params Array of Zend_XmlRpc_Value objects, parameters for the method * @throws Zend_Http_Client_Exception */ protected function _sendRequest($method, $params = null) { $request_data = $this->_buildRequest($method, $params); // @todo pluggable client? $http = new Zend_Http_Client($this->_serverAddress, array('Content-Type: text/xml')); $response = $http->post($request_data); /* @var $response Zend_Http_Response */ return $this->_parseResponse($response->getBody()); }
<?php set_include_path('/storage/htdocs/testing/ZendFramework-0.1.5/library'); require_once 'Zend/Http/Client.php'; // Instantiate our client object $http = new Zend_Http_Client(); // Set the URI to a POST data processor $http->setUri('http://unicron.bla/testing/server.php'); // Save specific GET variables as HTTP POST data $postData = 'foo=' . urlencode('this is foo') . '&bar=' . urlencode('this is bar'); // Make the HTTP POST request and save the HTTP response $httpResponse = $http->post($postData); echo $httpResponse->getBody();