Class HistoryPlugin
Maintains a list of requests and responses sent using a request or client
- Guzzle\Plugin\History\HistoryPlugin implements Symfony\Component\EventDispatcher\EventSubscriberInterface, IteratorAggregate, Countable
Methods summary
-
public staticgetSubscribedEvents ( ) -
public__toString ( )Convert to a string that contains all request and response headers
-
publicadd ( Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response = null )Add a request to the history
-
publicsetLimit ( int $limit )Set the max number of requests to store
-
publicgetLimit ( )Get the request limit
-
publicgetAll ( )Get all of the raw transactions in the form of an array of associative arrays containing 'request' and 'response' keys.
-
publicgetIterator ( )Get the requests in the history
-
publiccount ( )Get the number of requests in the history
-
publicgetLastRequest ( )Get the last request sent
-
publicgetLastResponse ( )Get the last response in the history
-
publicclear ( )Clears the history
-
publiconRequestSent ( Guzzle\Common\Event $event )
Methods detail
Convert to a string that contains all request and response headers
Returns
string
public
Guzzle\Plugin\History\HistoryPlugin
add( Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response = null )
Add a request to the history
Parameters
- $request
Guzzle\Http\Message\RequestInterface
$request Request to add- $response
Guzzle\Http\Message\Response
$response Response of the request
Returns
Set the max number of requests to store
Parameters
- $limit
integer
$limit Limit
Returns
Get the request limit
Returns
integerGet all of the raw transactions in the form of an array of associative arrays containing 'request' and 'response' keys.
Returns
arrayGet the requests in the history
Returns
Implementation of
Magic methods summary
Properties summary
protected
integer
|
$limit |
#
The maximum number of requests to maintain in the history |
protected
array
|
$transactions |
#
Requests and responses that have passed through the plugin |