X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=docs%2Fexamples%2Ftutorial.txt;h=96ee9de72cd4652ccb7b9c1f3e856a77beaa6ae4;hb=4c47eabee60a0266f3f27bf91528830b32da842e;hp=d8d9fad84581dd48afd41703bc5d456f5feaf6f9;hpb=07af5d267afdfdaa2b7e9c29174364bf313634ef;p=m6w6%2Fext-http diff --git a/docs/examples/tutorial.txt b/docs/examples/tutorial.txt index d8d9fad..96ee9de 100644 --- a/docs/examples/tutorial.txt +++ b/docs/examples/tutorial.txt @@ -12,11 +12,12 @@ $Revision$ read from and written to a file. setOptions( - array( 'cookiestore' => '../cookies/google.txt', + array( 'cookiestore' => 'google.txt', ) ); @@ -44,7 +45,7 @@ try { redirect option. attach(new HttpRequest('http://pear.php.net', HTTP_HEAD)); - $p->attach(new HttpRequest('http://pecl.php.net', HTTP_HEAD)); + $p->attach(new HttpRequest('http://pear.php.net', HTTP_METH_HEAD)); + $p->attach(new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD)); } catch (HttpException $e) { print $e; exit; @@ -112,8 +113,8 @@ class Pool extends HttpRequestPool public function __construct() { parent::__construct( - new HttpRequest('http://pear.php.net', HTTP_HEAD), - new HttpRequest('http://pecl.php.net', HTTP_HEAD) + new HttpRequest('http://pear.php.net', HTTP_METH_HEAD), + new HttpRequest('http://pecl.php.net', HTTP_METH_HEAD) ); // HttpRequestPool methods socketPerform() and socketSelect() are @@ -186,7 +187,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'); } @@ -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());