- changelog
[m6w6/ext-http] / tests / request_cookies.phpt
1 --TEST--
2 urlencoded cookies
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkver(5);
7 skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
8 ?>
9 --FILE--
10 <?php
11 echo "-TEST\n";
12
13 $cookies = array("name" => "val=ue");
14
15 $r = new HttpRequest("http://dev.iworks.at/ext-http/.print_request.php", HTTP_METH_GET, array("cookies" => $cookies));
16 $r->recordHistory = true;
17 $r->send();
18 $r->setOptions(array('encodecookies' => false));
19 $r->send();
20 echo $r->getHistory()->toString(true);
21
22 echo "Done\n";
23 ?>
24 --EXPECTF--
25 %sTEST
26 GET /ext-http/.print_request.php HTTP/1.1
27 User-Agent: %s
28 Host: dev.iworks.at
29 Accept: */*
30 Cookie: name=val%3Due
31 HTTP/1.1 200 OK
32 %s
33
34 Array
35 (
36 [name] => val=ue
37 )
38
39 GET /ext-http/.print_request.php HTTP/1.1
40 User-Agent: %s
41 Host: dev.iworks.at
42 Accept: */*
43 Cookie: name=val=ue;
44 HTTP/1.1 200 OK
45 %s
46
47 Array
48 (
49 [name] => val=ue
50 )
51
52 Done