toUri
Returns this URL as a URI. Because URI is more strict than this class, the returned URI may be semantically different from this URL:
Characters forbidden by URI like
[and|will be escaped.Invalid percent-encoded sequences like
%xxwill be encoded like%25xx.Whitespace and control characters in the fragment will be stripped.
These differences may have a significant consequence when the URI is interpreted by a web server. For this reason the URI and this method should be avoided.