back to dev
[m6w6/ext-http] / tests / client025.phpt
1 --TEST--
2 client seek
3 --SKIPIF--
4 <?php
5 include "skipif.inc";
6 ?>
7 --FILE--
8 <?php
9
10 include "helper/server.inc";
11
12 echo "Test\n";
13
14 server("proxy.inc", function($port) {
15 $client = new http\Client;
16 $request = new http\Client\Request("PUT", "http://localhost:$port");
17 $request->setOptions(array("resume" => 1, "expect_100_timeout" => 0));
18 $request->getBody()->append("123");
19 echo $client->enqueue($request)->send()->getResponse();
20 });
21 // Content-length is 2 instead of 3 in older libcurls
22 ?>
23 ===DONE===
24 --EXPECTF--
25 Test
26 HTTP/1.1 200 OK
27 Accept-Ranges: bytes
28 Etag: "%x"
29 X-Original-Transfer-Encoding: chunked
30 Content-Length: %d
31
32 PUT / HTTP/1.1
33 Content-Range: bytes 1-2/3
34 User-Agent: %s
35 Host: localhost:%d
36 Accept: */*
37 Content-Length: %d
38 Expect: 100-continue
39 X-Original-Content-Length: %d
40
41 23===DONE===