require_once "HTTP/Request.php";
$req =& new HTTP_Request("http://example.com/");
$req->addCookie("version", phpversion());
$response = $req->sendRequest();
if (PEAR::isError($response)) {
echo $response->getMessage();
} else {
echo $req->getResponseBody();
} |