- fix write access of HttpMessage properties
[m6w6/ext-http] / docs / examples / KISS_XMLRPC_Client.php
index 35380db9853759d19df1b1ca6c1bd7cb0e54896e..ac7498d611caa9f87d6fd2af5a5de2eb7c89e497 100644 (file)
@@ -7,7 +7,7 @@ class XmlRpcClient
        public function __construct($url, $namespace = '')
        {
                $this->namespace = $namespace;
-               $this->request = new HttpRequest($url, HTTP_POST);
+               $this->request = new HttpRequest($url, HTTP_METH_POST);
                $this->request->setContentType('text/xml');
        }
 
@@ -26,7 +26,7 @@ class XmlRpcClient
                if ($this->namespace) {
                        $method = $this->namespace .'.'. $method;
                }
-               $this->request->setPostData(xmlrpc_encode_request($method, $params));
+               $this->request->setRawPostData(xmlrpc_encode_request($method, $params));
                $response = $this->request->send();
                if ($response->getResponseCode() != 200) {
                        throw new Exception($response->getBody(), $response->getResponseCode());