- use http_get_request_body() on the server side
[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 PUT /.print_put.php5 HTTP/1.1
44 User-Agent: PECL::HTTP/%s
45 Host: dev.iworks.at
46 Accept: */*
47 Content-Type: text/plain
48 Content-Length: 281
49 Expect: 100-continue
50
51 <?php
52 echo "-TEST\n";
53
54 $r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
55 $r->recordHistory = true;
56 $r->addHeaders(array('content-type' => 'text/plain'));
57 $r->setPutFile(__FILE__);
58 $r->send();
59 var_dump($r->getHistory()->toString(true));
60 echo "Done\n";
61 ?>
62
63 "
64 Done
65