X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=docs%2Fexamples%2Ftutorial.txt;h=fbe9f210758fc659d7bdec23bbd57f5fcf083dd6;hb=e7e38363a2e833933519deb5f649d34fd7cc658d;hp=b29fa96c99b10b83fac958979936ab950fbda156;hpb=229730a74c2686bdf501528cbe44a9421ccca61a;p=m6w6%2Fext-http diff --git a/docs/examples/tutorial.txt b/docs/examples/tutorial.txt index b29fa96..fbe9f21 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', ) ); @@ -27,7 +28,7 @@ $r->setQueryData( ); // HttpRequest::send() returns an HttpMessage object -// of type HttpMessage::RESPONSE or throws an exception +// of type HttpMessage::TYPE_RESPONSE or throws an exception try { print $r->send()->getBody(); } catch (HttpException $e) { @@ -61,6 +62,7 @@ $r->setPostFields( ) ); // add the file to post (form name, file name, file type) +touch('profile.jpg'); $r->addPostFile('image', 'profile.jpg', 'image/jpeg'); try { @@ -205,7 +207,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());