1 # http\Message http\Client::getHistory()
3 Simply returns the http\Message chain representing the request/response history.
5 > **Note:** The history is only recorded while http\Client::$recordHistory is true.
13 * http\Message, the request/response message chain representing the client's history.
17 * http\Exception\InvalidArgumentException
22 $client = new http\Client;
23 $client->enqueue(new http\Client\Request("HEAD", "http://php.net"));
24 $client->enqueue(new http\Client\Request("HEAD", "http://pecl.php.net"));
25 $client->enqueue(new http\Client\Request("HEAD", "http://pear.php.net"));
26 $client->recordHistory = true;
29 echo $client->getHistory()->toString(true);
34 User-Agent: PECL::HTTP/2.0.0dev (PHP/5.5.5)
40 Date: Mon, 04 Nov 2013 15:41:48 GMT
42 X-Powered-By: PHP/5.3.6
44 Content-Type: text/html; charset=UTF-8
48 User-Agent: PECL::HTTP/2.0.0dev (PHP/5.5.5)
54 Date: Mon, 04 Nov 2013 14:34:02 GMT
56 X-Powered-By: PHP/5.2.17
58 Expires: Thu, 19 Nov 1981 08:52:00 GMT
59 Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
62 Content-Type: text/html; charset=ISO-8859-1
66 User-Agent: PECL::HTTP/2.0.0dev (PHP/5.5.5)
73 Date: Mon, 04 Nov 2013 14:34:08 GMT
74 Content-Type: text/html;charset=utf-8
75 Connection: keep-alive
76 X-Powered-By: PHP/5.5.4-1
79 Last-Modified: Mon, 04 Nov 2013 21:00:36 GMT