11 include "helper/server.inc";
17 $r[key($a)]=reset($a);
21 server("env.inc", function($port) {
22 $client = new http\Client;
23 $client->setCookies(array("test" => "bar"));
24 $client->addCookies(array("foo" => "test"));
26 $request = new http\Client\Request("GET", "http://localhost:$port");
27 $client->enqueue($request);
29 echo $client->getResponse()->getBody()->toString();
31 $request->setOptions(array("cookies" => x($client->getCookies())));
32 $client->requeue($request);
35 echo $client->getResponse()->getBody()->toString();