- use http_get_request_body() on the server side
authorMichael Wallner <mike@php.net>
Tue, 10 Jan 2006 19:04:43 +0000 (19:04 +0000)
committerMichael Wallner <mike@php.net>
Tue, 10 Jan 2006 19:04:43 +0000 (19:04 +0000)
tests/HttpRequest_007.phpt

index cf651be..74ce527 100644 (file)
@@ -9,35 +9,57 @@ checkcls('HttpRequest');
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
 $r->send();
-var_dump($r->getRawRequestMessage());
+var_dump($r->getHistory()->toString(true));
 echo "Done\n";
 ?>
 --EXPECTF--
 %sTEST
-string(%d) "PUT /.print_request.php HTTP/1.1
-User-Agent: %s
+string(%d) "HTTP/1.1 200 OK
+Date: %s
+Server: Apache/%s
+X-Powered-By: PHP/5%s
+Vary: Accept-Encoding
+Content-Type: text/html
+X-Original-Transfer-Encoding: chunked
+Content-Length: 281
+
+<?php
+echo "-TEST\n";
+
+$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
+$r->recordHistory = true;
+$r->addHeaders(array('content-type' => 'text/plain'));
+$r->setPutFile(__FILE__);
+$r->send();
+var_dump($r->getHistory()->toString(true));
+echo "Done\n";
+?>
+
+PUT /.print_put.php5 HTTP/1.1
+User-Agent: PECL::HTTP/%s
 Host: dev.iworks.at
 Accept: */*
-content-type: text/plain
-Content-Length: 278
+Content-Type: text/plain
+Content-Length: 281
 Expect: 100-continue
 
 <?php
 echo "-TEST\n";
 
-$r = new HttpRequest('http://dev.iworks.at/.print_request.php', HTTP_METH_PUT);
+$r = new HttpRequest('http://dev.iworks.at/.print_put.php5', HTTP_METH_PUT);
 $r->recordHistory = true;
 $r->addHeaders(array('content-type' => 'text/plain'));
 $r->setPutFile(__FILE__);
 $r->send();
-var_dump($r->getRawRequestMessage());
+var_dump($r->getHistory()->toString(true));
 echo "Done\n";
 ?>
+
 "
 Done