Skip to content
class method

URI.join

(::_ToStr | ::URI::Generic str, *::_ToStr | ::URI::Generic strs) -> ::URI::Generic
join(*str)

Merges the given URI strings str per RFC 2396.

Each string in str is converted to an RFC3986 URI before being merged.

Examples:

Example
URI.join("http://example.com/","main.rbx")
# => #<URI::HTTP http://example.com/main.rbx>

URI.join('http://example.com', 'foo')
# => #<URI::HTTP http://example.com/foo>

URI.join('http://example.com', '/foo', '/bar')
# => #<URI::HTTP http://example.com/bar>

URI.join('http://example.com', '/foo', 'bar')
# => #<URI::HTTP http://example.com/bar>

URI.join('http://example.com', '/foo/', 'bar')
# => #<URI::HTTP http://example.com/foo/bar>
See also .for .open .encode_www_form_component .parse also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0