blueshoes php application framework and cms            core_net
[ class tree: core_net ] [ index: core_net ] [ all elements ]

example


1 <?php
2
3 //require dependencies
4 if (!isSet($GLOBALS['APP']['path']['diffFromDocRootToGlobalConf'])) $GLOBALS['APP']['path']['diffFromDocRootToGlobalConf'] = '../';
5 require_once($_SERVER['DOCUMENT_ROOT'] . $GLOBALS['APP']['path']['diffFromDocRootToGlobalConf'] . 'global.conf.php');
6 require_once($APP['path']['core'] . 'net/http/Bs_HttpClient.class.php');
7
8 $url = 'http://www.blueshoes.ws/';
9 $httpClient =& new Bs_HttpClient();
10 //$httpClient->sendProtocolVersion = 'HTTP/1.1';
11 $content = $httpClient->fetchPage($url);
12 if (isEx($content)) {
13 $content->stackDump('die');
14 } else {
15 //$content = $httpClient->fetchPage($url, NULL, NULL, NULL, 'HEAD', TRUE);
16 echo "the response code was: " . $httpClient->responseCode . "<br>\n";
17 $codeInfo = $httpClient->responseCodeInfo($httpClient->responseCode, $httpClient->sendProtocolVersion);
18 dump($codeInfo);
19 echo "that means: " . $codeInfo[0] . "<br>\n";
20 if (!empty($codeInfo[1])) echo "that means: " . $codeInfo[1] . "<br>\n";
21 }
22
23 ?>

Documentation generated on Mon, 29 Dec 2003 21:11:12 +0100 by phpDocumentor 1.2.3