1 # http\Message http\Client::getHistory()
3 Simply returns the http\Message chain representing the request/response history.
6 > The history is only recorded while http\Client::$recordHistory is true.
14 * http\Message, the request/response message chain representing the client's history.
18 * http\Exception\InvalidArgumentException
23 $client = new http\Client;
24 $client->enqueue(new http\Client\Request("HEAD", "http://php.net"));
25 $client->enqueue(new http\Client\Request("HEAD", "http://pecl.php.net"));
26 $client->enqueue(new http\Client\Request("HEAD", "http://pear.php.net"));
27 $client->recordHistory = true;
30 echo $client->getHistory()->toString(true);
35 User-Agent: PECL::HTTP/2.0.0dev (PHP/5.5.5)
41 Date: Mon, 04 Nov 2013 15:41:48 GMT
43 X-Powered-By: PHP/5.3.6
45 Content-Type: text/html; charset=UTF-8
49 User-Agent: PECL::HTTP/2.0.0dev (PHP/5.5.5)
55 Date: Mon, 04 Nov 2013 14:34:02 GMT
57 X-Powered-By: PHP/5.2.17
59 Expires: Thu, 19 Nov 1981 08:52:00 GMT
60 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
63 Content-Type: text/html; charset=ISO-8859-1
67 User-Agent: PECL::HTTP/2.0.0dev (PHP/5.5.5)
74 Date: Mon, 04 Nov 2013 14:34:08 GMT
75 Content-Type: text/html;charset=utf-8
76 Connection: keep-alive
77 X-Powered-By: PHP/5.5.4-1
80 Last-Modified: Mon, 04 Nov 2013 21:00:36 GMT