public static function createRingRequest(RequestInterface $request)
    {
        $options = $request->getConfig()->toArray();
        $url = $request->getUrl();
        // No need to calculate the query string twice (in URL and query).
        $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null;

        return [
            'scheme'       => $request->getScheme(),
            'http_method'  => $request->getMethod(),
            'url'          => $url,
            'uri'          => $request->getPath(),
            'headers'      => $request->getHeaders(),
            'body'         => $request->getBody(),
            'version'      => $request->getProtocolVersion(),
            'client'       => $options,
            'query_string' => $qs,
            'future'       => isset($options['future']) ? $options['future'] : false
        ];
    }
public static function createRingRequest(RequestInterface $request)
    {
        $options = $request->getConfig()->toArray();
        $url = $request->getUrl();
        // No need to calculate the query string twice (in URL and query).
        $qs = ($pos = strpos($url, '?')) ? substr($url, $pos + 1) : null;

        return [
            'scheme'       => $request->getScheme(),
            'http_method'  => $request->getMethod(),
            'url'          => $url,
            'uri'          => $request->getPath(),
            'headers'      => $request->getHeaders(),
            'body'         => $request->getBody(),
            'version'      => $request->getProtocolVersion(),
            'client'       => $options,
            'query_string' => $qs,
            'future'       => isset($options['future']) ? $options['future'] : false
        ];
    }
public static function createRingRequest ( RequestInterface $ request ) { $ options = $ request -> getConfig ( ) -> toArray ( ) ; $ url = $ request -> getUrl ( ) ; // No need to calculate the query string twice (in URL and query). $ qs = ( $ pos = strpos ( $ url , '?' ) ) ? substr ( $ url , $ pos + 1 ) : null ; return [ 'scheme' => $ request -> getScheme ( ) , 'http_method' => $ request -> getMethod ( ) , 'url' => $ url , 'uri' => $ request -> getPath ( ) , 'headers' => $ request -> getHeaders ( ) , 'body' => $ request -> getBody ( ) , 'version' => $ request -> getProtocolVersion ( ) , 'client' => $ options , 'query_string' => $ qs , 'future' => isset ( $ options [ 'future' ] ) ? $ options [ 'future' ] : false ] ; }
Creates a Ring request from a request object.

This function does not hook up the "then" and "progress" events that
would be required for actually sending a Guzzle request through a
RingPHP handler.

@param RequestInterface $request Request to convert.

@return array Converted Guzzle Ring request.
Creates a Ring request from a request object .