11 include "helper/server.inc";
15 server("env.inc", function($port) {
16 $body = new http\Message\Body;
17 $body->append("foobar");
19 $request = new http\Client\Request;
20 $request->setBody($body);
21 $request->setRequestMethod("POST");
22 $request->setRequestUrl("http://localhost:$port");
24 $client = new http\Client;
25 $client->recordHistory = true;
27 $client->enqueue($request)->send();
28 echo $client->getHistory()->toString(true);
30 $client->requeue($request)->send();
31 echo $client->getHistory()->toString(true);
37 POST http://localhost:%d/ HTTP/1.1
43 X-Request-Content-Length: 6
44 X-Original-Transfer-Encoding: chunked
49 POST http://localhost:%d/ HTTP/1.1
55 X-Request-Content-Length: 6
56 X-Original-Transfer-Encoding: chunked
61 POST http://localhost:%d/ HTTP/1.1
67 X-Request-Content-Length: 6
68 X-Original-Transfer-Encoding: chunked