method
parse
parse(uri)
public
Synopsis
URI::parse(uri_str)
Args
uri_str |
Description
Creates one of the URI’s subclasses instance from the string.
Raises
Raised if URI given is not a correct one. |
Usage
require 'uri' uri = URI.parse("http://www.ruby-lang.org/") # => #<URI::HTTP http://www.ruby-lang.org/> uri.scheme # => "http" uri.host # => "www.ruby-lang.org"
It’s recommended to first ::escape the provided uri_str if there are any invalid URI characters.