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 static
getSubscribedEvents ( )
-
public
__toString ( )
Convert to a string that contains all request and response headers
-
public
add ( Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response = null )
Add a request to the history
-
public
setLimit ( int $limit )
Set the max number of requests to store
-
public
getLimit ( )
Get the request limit
-
public
getAll ( )
Get all of the raw transactions in the form of an array of associative arrays containing 'request' and 'response' keys.
-
public
getIterator ( )
Get the requests in the history
-
public
count ( )
Get the number of requests in the history
-
public
getLastRequest ( )
Get the last request sent
-
public
getLastResponse ( )
Get the last response in the history
-
public
clear ( )
Clears the history
-
public
onRequestSent ( 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
integer
Get all of the raw transactions in the form of an array of associative arrays containing 'request' and 'response' keys.
Returns
array
Get 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 |