fix bug #69357
[m6w6/ext-http] / tests / bug69313.phpt
1 --TEST--
2 Bug #69313 (http\Client doesn't send GET body)
3 --SKIPIF--
4 <?php
5 include "./skipif.inc";
6 skip_client_test();
7 ?>
8 --FILE--
9 <?php
10
11
12 include "helper/server.inc";
13
14 echo "Test\n";
15
16 server("proxy.inc", function($port, $stdin, $stdout, $stderr) {
17 $request = new http\Client\Request("GET", "http://localhost:$port/");
18 $request->setHeader("Content-Type", "text/plain");
19 $request->getBody()->append("foo");
20 $client = new http\Client();
21 $client->enqueue($request);
22 $client->send();
23 echo $client->getResponse();
24 });
25
26 ?>
27
28 Done
29 --EXPECTF--
30 Test
31 HTTP/1.1 200 OK
32 Accept-Ranges: bytes
33 Etag: "%s"
34 X-Original-Transfer-Encoding: chunked
35 Content-Length: %d
36
37 GET / HTTP/1.1
38 User-Agent: %s
39 Host: localhost:%d
40 Accept: */*
41 Content-Type: text/plain
42 Content-Length: 3
43 X-Original-Content-Length: 3
44
45 foo
46 Done