private function collectRequestInformation(RequestInterface $request, Stack $stack = null)
    {
        if (empty($stack->getRequestTarget())) {
            $stack->setRequestTarget($request->getRequestTarget());
        }
        if (empty($stack->getRequestMethod())) {
            $stack->setRequestMethod($request->getMethod());
        }
        if (empty($stack->getRequestScheme())) {
            $stack->setRequestScheme($request->getUri()->getScheme());
        }
        if (empty($stack->getRequestHost())) {
            $stack->setRequestHost($request->getUri()->getHost());
        }
        if (empty($stack->getClientRequest())) {
            $stack->setClientRequest($this->formatter->formatRequest($request));
        }
        if (empty($stack->getCurlCommand())) {
            $stack->setCurlCommand($this->formatter->formatAsCurlCommand($request));
        }
    }
private function collectRequestInformation(RequestInterface $request, Stack $stack = null)
    {
        if (empty($stack->getRequestTarget())) {
            $stack->setRequestTarget($request->getRequestTarget());
        }
        if (empty($stack->getRequestMethod())) {
            $stack->setRequestMethod($request->getMethod());
        }
        if (empty($stack->getRequestScheme())) {
            $stack->setRequestScheme($request->getUri()->getScheme());
        }
        if (empty($stack->getRequestHost())) {
            $stack->setRequestHost($request->getUri()->getHost());
        }
        if (empty($stack->getClientRequest())) {
            $stack->setClientRequest($this->formatter->formatRequest($request));
        }
        if (empty($stack->getCurlCommand())) {
            $stack->setCurlCommand($this->formatter->formatAsCurlCommand($request));
        }
    }
private function collectRequestInformation ( RequestInterface $ request , Stack $ stack = null ) { if ( empty ( $ stack -> getRequestTarget ( ) ) ) { $ stack -> setRequestTarget ( $ request -> getRequestTarget ( ) ) ; } if ( empty ( $ stack -> getRequestMethod ( ) ) ) { $ stack -> setRequestMethod ( $ request -> getMethod ( ) ) ; } if ( empty ( $ stack -> getRequestScheme ( ) ) ) { $ stack -> setRequestScheme ( $ request -> getUri ( ) -> getScheme ( ) ) ; } if ( empty ( $ stack -> getRequestHost ( ) ) ) { $ stack -> setRequestHost ( $ request -> getUri ( ) -> getHost ( ) ) ; } if ( empty ( $ stack -> getClientRequest ( ) ) ) { $ stack -> setClientRequest ( $ this -> formatter -> formatRequest ( $ request ) ) ; } if ( empty ( $ stack -> getCurlCommand ( ) ) ) { $ stack -> setCurlCommand ( $ this -> formatter -> formatAsCurlCommand ( $ request ) ) ; } }
Collect request information when not already done by the HTTP client. This happens when using the CachePlugin
and the cache is hit without re-validation.

@param RequestInterface $request
@param Stack|null       $stack
Collect request information when not already done by the HTTP client . This happens when using the CachePlugin and the cache is hit without re - validation .