Re: package proposal: HTTP_SimpleClient
| From: | Wolfram Kriesing | Date: | Wed, 04 Jun 2003 13:33:07 +0000 |
| Subject: | Re: package proposal: HTTP_SimpleClient | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17005@lists.php.net to get a copy of this message | ||
esp. with the cookie handling i think it will be great for unit tests which can also handle html stuff and checking proper redirections and workflow stuff ... and much more, that will probably occur to me when i have submitted this mail :-)
+1
Alexey Borzov wrote:
Greetings! The HTTP::SimpleClient class wraps around HTTP::Request and provides a higher level interface for performing HTTP requests: $client =& new HTTP_SimpleClient(); $client->post($url, array('login' => $login, 'password' => $password)); instead of $request =& new HTTP_Request($url); $request->setMethod(HTTP_REQUEST_METHOD_POST); $request->addPostData('login', $login); $request->addPostData('password', $password); $request->sendRequest(); Features: * manages cookies and referrers between requests * handles HTTP redirection * ability to set default headers and request parameters * implements the Subject-Observer design pattern: the base class sends events to listeners that do the response processing. Source is available for review http://158.250.10.119/pear/SimpleClient.phps http://158.250.10.119/pear/CookieManager.phps http://158.250.10.119/pear/Listener.phps a usage example is available, too: a Listener implementation that does link checking with a script to use this http://158.250.10.119/pear/LinkChecker.phps http://158.250.10.119/pear/link-checker.phps-- Wolfram ... opensource @ vision:produktion ... http://opensource.visionp.de ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/auth