3
namespace GuzzleHttp\Event;
5
use GuzzleHttp\Message\ResponseInterface;
8
* Event object emitted before a request is sent.
10
* You may change the Response associated with the request using the
11
* intercept() method of the event.
13
class BeforeEvent extends AbstractRequestEvent
16
* Intercept the request and associate a response
18
* @param ResponseInterface $response Response to set
20
public function intercept(ResponseInterface $response)
22
$this->getTransaction()->setResponse($response);
23
$this->stopPropagation();
24
RequestEvents::emitComplete($this->getTransaction());