| // +-----------------------------------------------------------------------+ /** * This will grab a webpage and display it * * @category HTTP * @package HTTP_Request * @version CVS: $Id: example.php,v 1.7 2007/05/18 19:20:12 avb Exp $ * @ignore */ /** * Class for performing HTTP requests */ include('HTTP/Request.php'); $req = &new HTTP_Request('http://www.php.net'); $req->setMethod(HTTP_REQUEST_METHOD_POST); $req->addPostData('Foo', 'bar'); $req->sendRequest(); $response1 = $req->getResponseBody(); $req->setMethod(HTTP_REQUEST_METHOD_GET); $req->setURL('http://pear.php.net'); $req->clearPostData(); $req->sendRequest(); $response2 = $req->getResponseBody(); echo $response1; echo $response2; ?>