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