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

example


1 <?php
2 define('BS_HTTPCLIENT_VERSION', '4.5.$Revision: 1.1.1.1 $');
3
4 //require dependencies
5 $GLOBAL_CONF_TINY = TRUE;
6 require_once($_SERVER['DOCUMENT_ROOT'] . '../global.conf.php');
7 require_once($APP['path']['core'] . 'net/http/Bs_HttpClient.class.php');
8 require_once($APP['path']['core'] . 'util/Bs_StopWatch.class.php');
9
10 $url = 'http://www.blueshoes.org/';
11
12 $httpClient =& new Bs_HttpClient();
13 //$httpClient->stopWatch =& new Bs_StopWatch();
14 //$httpClient->sendProtocolVersion = 'HTTP/1.1';
15 $httpClient->parseHeader = TRUE;
16 $html = $httpClient->fetchPage($url, $host=NULL, $port=NULL, $postData=NULL, $method=NULL, $tryReconnect=TRUE);
17 if (isEx($html)) {
18 $html->stackDump('die');
19 } else {
20 echo $httpClient->responseCode;
21 dump($httpClient->headerRaw);
22 dump($httpClient->headerParsed);
23 }
24 //$httpClient->stopWatch->takeTime('fetchPage() ' . __FILE__ . ':' . __LINE__);
25 //echo $httpClient->stopWatch->toHtml();
26 ?>

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