summaryrefslogtreecommitdiffstats
path: root/bug69313.phpt
blob: 824918cb325fdb8055f4570ff3236262e0bb72c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--TEST--
Bug #69313 (http\Client doesn't send GET body)
--SKIPIF--
<?php
include "./skipif.inc";
skip_client_test();
?>
--FILE--
<?php


include "helper/server.inc";

echo "Test\n";

server("proxy.inc", function($port, $stdin, $stdout, $stderr) {
	$request = new http\Client\Request("GET", "http://localhost:$port/");
	$request->setHeader("Content-Type", "text/plain");
	$request->getBody()->append("foo");
	$client = new http\Client();
	$client->enqueue($request);
	$client->send();
	echo $client->getResponse();
});

?>

Done
--EXPECTF--
Test
HTTP/1.1 200 OK
Accept-Ranges: bytes
Etag: "%s"
X-Original-Transfer-Encoding: chunked
Content-Length: %d

GET / HTTP/1.1
User-Agent: %s
Host: localhost:%d
Accept: */*
Content-Type: text/plain
Content-Length: 3
X-Original-Content-Length: 3

foo
Done