X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=lib%2FXmlRpcClient.php;fp=lib%2FXmlRpcClient.php;h=488e1cf0c59e91f25f6406acedb56c0b9bc0bc58;hp=c7abb2a04592aac4979ab118e0305522dc4492d1;hb=f39ea2b145caa37d9614a8a437ffd3d8914b52f0;hpb=8100ac331745453877d4d939e2698b5acdfd1d1f diff --git a/lib/XmlRpcClient.php b/lib/XmlRpcClient.php index c7abb2a..488e1cf 100644 --- a/lib/XmlRpcClient.php +++ b/lib/XmlRpcClient.php @@ -54,7 +54,7 @@ class XmlRpcClient * @param string $namespace RPC namespace * @param array $options HttpRequest options */ - public function __construct($url, $namespace = '', array $options = null) + public function __construct($url, $namespace = '', array $options = array()) { $this->__request = new HttpRequest($url, HttpRequest::METH_POST, $options); $this->__namespace = $namespace; @@ -70,15 +70,14 @@ class XmlRpcClient */ public function __call($method, array $params) { - if ($this->__namespace) { + if (strlen($this->__namespace)) { $method = $this->__namespace .'.'. $method; } - $this->__request->setContentType("text/xml; charset=". $this->__encoding); + $this->__request->setContentType("text/xml"); $this->__request->setRawPostData( xmlrpc_encode_request($method, $params, array("encoding" => $this->__encoding))); - $this->__request->send(); - $response = $this->__request->getResponseMessage(); + $response = $this->__request->send(); if ($response->getResponseCode() != 200) { throw new Exception( $response->getResponseStatus(),