public function download($url, $dest, $data = null, $headers = [])
    {
        $request = $this->prepareRequest(new Request(), 'GET', $url, $data, $headers);

        $transport = $this->getTransport();

        if (!$transport::isSupported()) {
            throw new \RangeException(get_class($transport) . ' driver not supported.');
        }

        return $transport->download($request, $dest);
    }
public function download($url, $dest, $data = null, $headers = [])
    {
        $request = $this->prepareRequest(new Request(), 'GET', $url, $data, $headers);

        $transport = $this->getTransport();

        if (!$transport::isSupported()) {
            throw new \RangeException(get_class($transport) . ' driver not supported.');
        }

        return $transport->download($request, $dest);
    }
public function download ( $ url , $ dest , $ data = null , $ headers = [ ] ) { $ request = $ this -> prepareRequest ( new Request ( ) , 'GET' , $ url , $ data , $ headers ) ; $ transport = $ this -> getTransport ( ) ; if ( ! $ transport :: isSupported ( ) ) { throw new \ RangeException ( get_class ( $ transport ) . ' driver not supported.' ) ; } return $ transport -> download ( $ request , $ dest ) ; }
Download file to target path.

@param string|object $url     The URL to request, may be string or Uri object.
@param string|       $dest    The dest file path can be a StreamInterface.
@param mixed         $data    The request body data, can be an array of POST data.
@param array         $headers The headers array.

@return  ResponseInterface
Download file to target path .