- examples fixup
[m6w6/ext-http] / docs / examples / tutorial.txt
index b29fa96c99b10b83fac958979936ab950fbda156..96ee9de72cd4652ccb7b9c1f3e856a77beaa6ae4 100644 (file)
@@ -12,11 +12,12 @@ $Revision$
        read from and written to a file.
 
 <?php
-$r = new HttpRequest('http://www.google.com');
+$r = new HttpRequest('http://www.google.com/search');
 
 // store Googles cookies in a dedicated file
+touch('google.txt');
 $r->setOptions(
-       array(  'cookiestore'   => '../cookies/google.txt',
+       array(  'cookiestore'   => 'google.txt',
        )
 );
 
@@ -205,7 +206,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());