- fix PHP4 build (has no only_exceptions INI setting
[m6w6/ext-http] / tests / HttpRequest_002.phpt
1 --TEST--
2 HttpRequest GET/POST
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5);
7 checkurl('www.google.com');
8 ?>
9 --FILE--
10 <?php
11 echo "-TEST\n";
12 $r = new HttpRequest('http://www.google.com', HTTP_GET);
13 var_dump($r->send());
14 print_r($r->getResponseInfo());
15 $r->setMethod(HTTP_POST);
16 $r->addPostFields(array('q'=>'foobar','start'=>10));
17 $r->send();
18 var_dump($r->getResponseCode());
19 var_dump($r->getResponseMessage()->getResponseCode());
20 var_dump(false != strstr($r->getResponseBody(), "Not Implemented"));
21 ?>
22 --EXPECTF--
23 %sTEST
24 bool(true)
25 Array
26 (
27 [effective_url] => http://www.google.com/
28 [response_code] => %d
29 [http_connectcode] => %d
30 [filetime] => %s
31 [total_time] => %f
32 [namelookup_time] => %f
33 [connect_time] => %f
34 [pretransfer_time] => %f
35 [starttransfer_time] => %f
36 [redirect_time] => %f
37 [redirect_count] => %f
38 [size_upload] => %f
39 [size_download] => %d
40 [speed_download] => %d
41 [speed_upload] => %d
42 [header_size] => %d
43 [request_size] => %d
44 [ssl_verifyresult] => %d
45 [content_length_download] => %d
46 [content_length_upload] => %d
47 [content_type] => %s
48 [httpauth_avail] => %d
49 [proxyauth_avail] => %s
50 )
51 int(501)
52 int(501)
53 bool(true)
54