2e9d48acbc247e2abd2afbb0319a1883e8f7fb0b
[m6w6/ext-http] / tests / HttpRequest_007.phpt
1 --TEST--
2 HttpRequest PUT
3 --SKIPIF--
4 <?php
5 include 'skip.inc';
6 checkcls('HttpRequest');
7 ?>
8 --FILE--
9 <?php
10 echo "-TEST\n";
11
12 $r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
13 $r->recordHistory = true;
14 $r->addHeaders(array('content-type' => 'text/plain'));
15 $r->setPutFile(__FILE__);
16 $r->send();
17 var_dump($r->getHistory()->toString(true));
18 echo "Done\n";
19 ?>
20 --EXPECTF--
21 %aTEST
22 string(%d) "PUT /ext-http/.print_put.php5 HTTP/1.1
23 User-Agent: PECL::HTTP/%a
24 Host: dev.iworks.at
25 Accept: */*
26 Content-Type: text/plain
27 Content-Length: %d
28 Expect: 100-continue
29
30 <?php
31 echo "-TEST\n";
32
33 $r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
34 $r->recordHistory = true;
35 $r->addHeaders(array('content-type' => 'text/plain'));
36 $r->setPutFile(__FILE__);
37 $r->send();
38 var_dump($r->getHistory()->toString(true));
39 echo "Done\n";
40 ?>
41
42 HTTP/1.1 100 Continue
43 HTTP/1.1 200 OK
44 Date: %a
45 Server: %a
46 Vary: Accept-Encoding
47 Content-Length: %d
48 Content-Type: text/html
49
50 <?php
51 echo "-TEST\n";
52
53 $r = new HttpRequest('http://dev.iworks.at/ext-http/.print_put.php5', HTTP_METH_PUT);
54 $r->recordHistory = true;
55 $r->addHeaders(array('content-type' => 'text/plain'));
56 $r->setPutFile(__FILE__);
57 $r->send();
58 var_dump($r->getHistory()->toString(true));
59 echo "Done\n";
60 ?>
61
62 "
63 Done