public function send(RequestInterface $request)
    {
        /** @var RequestEvent $event */
        $event = new RequestEvent($request);
        $event = $this->eventDispatcher->dispatch(ClientEvents::REQUEST, $event);

        $request = $event->getRequest();

        $response = $this->httpClient->send($request);

        /** @var ResponseEvent $event */
        $event = new ResponseEvent($response);
        $event = $this->eventDispatcher->dispatch(ClientEvents::RESPONSE, $event);

        return $event->getResponse();
    }
public function send(RequestInterface $request)
    {
        /** @var RequestEvent $event */
        $event = new RequestEvent($request);
        $event = $this->eventDispatcher->dispatch(ClientEvents::REQUEST, $event);

        $request = $event->getRequest();

        $response = $this->httpClient->send($request);

        /** @var ResponseEvent $event */
        $event = new ResponseEvent($response);
        $event = $this->eventDispatcher->dispatch(ClientEvents::RESPONSE, $event);

        return $event->getResponse();
    }
public function send ( RequestInterface $ request ) { /** @var RequestEvent $event */ $ event = new RequestEvent ( $ request ) ; $ event = $ this -> eventDispatcher -> dispatch ( ClientEvents :: REQUEST , $ event ) ; $ request = $ event -> getRequest ( ) ; $ response = $ this -> httpClient -> send ( $ request ) ; /** @var ResponseEvent $event */ $ event = new ResponseEvent ( $ response ) ; $ event = $ this -> eventDispatcher -> dispatch ( ClientEvents :: RESPONSE , $ event ) ; return $ event -> getResponse ( ) ; }
Sends a psr-7 request, while dispatching request + response events

@param RequestInterface $request

@return ResponseInterface
Sends a psr - 7 request while dispatching request + response events