src/Http/Request.php
public static function create($method = 'GET', $url = null, $config = [])
    {
        if (func_num_args()) {
            if(!preg_match('~^(?:[a-z]+:)?//~i', $url) || !$defaults = parse_url($url)) {
                throw new NetException("Invalid url: `'{$url}'`.");
            }
            $defaults['username'] = isset($defaults['user']) ? $defaults['user'] : null;
            $defaults['password'] = isset($defaults['pass']) ? $defaults['pass'] : null;
        }
        $config['method'] = strtoupper($method);
        return new static($config + $defaults);
    }
public static function create($method = 'GET', $url = null, $config = [])
    {
        if (func_num_args()) {
            if(!preg_match('~^(?:[a-z]+:)?//~i', $url) || !$defaults = parse_url($url)) {
                throw new NetException("Invalid url: `'{$url}'`.");
            }
            $defaults['username'] = isset($defaults['user']) ? $defaults['user'] : null;
            $defaults['password'] = isset($defaults['pass']) ? $defaults['pass'] : null;
        }
        $config['method'] = strtoupper($method);
        return new static($config + $defaults);
    }
public static function create ( $ method = 'GET' , $ url = null , $ config = [ ] ) { if ( func_num_args ( ) ) { if ( ! preg_match ( '~^(?:[a-z]+:)?//~i' , $ url ) || ! $ defaults = parse_url ( $ url ) ) { throw new NetException ( "Invalid url: `'{$url}'`." ) ; } $ defaults [ 'username' ] = isset ( $ defaults [ 'user' ] ) ? $ defaults [ 'user' ] : null ; $ defaults [ 'password' ] = isset ( $ defaults [ 'pass' ] ) ? $ defaults [ 'pass' ] : null ; } $ config [ 'method' ] = strtoupper ( $ method ) ; return new static ( $ config + $ defaults ) ; }
Creates a request instance using an absolute URL.

@param  string $url    An absolute URL.
@param  array  $config The config array.
@return self
Creates a request instance using an absolute URL .