- reverse request history
[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/.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 %sTEST
22 string(%d) "HTTP/1.1 200 OK
23 Date: %s
24 Server: Apache/%s
25 X-Powered-By: PHP/5%s
26 Vary: Accept-Encoding
27 Content-Type: text/html
28 X-Original-Transfer-Encoding: chunked
29 Content-Length: 281
30
31 <?php
32 echo "-TEST\n";
33
34 $r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
35 $r->recordHistory = true;
36 $r->addHeaders(array('content-type' => 'text/plain'));
37 $r->setPutFile(__FILE__);
38 $r->send();
39 var_dump($r->getHistory()->toString(true));
40 echo "Done\n";
41 ?>
42
43 HTTP/1.1 100 Continue
44 PUT /.print_put.php5 HTTP/1.1
45 User-Agent: PECL::HTTP/%s
46 Host: dev.iworks.at
47 Accept: */*
48 Content-Type: text/plain
49 Content-Length: 281
50 Expect: 100-continue
51
52 <?php
53 echo "-TEST\n";
54
55 $r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
56 $r->recordHistory = true;
57 $r->addHeaders(array('content-type' => 'text/plain'));
58 $r->setPutFile(__FILE__);
59 $r->send();
60 var_dump($r->getHistory()->toString(true));
61 echo "Done\n";
62 ?>
63
64 "
65 Done
66