Convert this URL to a string. The string is properly formatted and usable for, eg, a web request.
The port. This is inferred from the scheme if it isn't present in the URL itself. If the scheme is not known and the port is not present, the port will be given as 0. For some schemes, port will not be sensible -- for instance, file or chrome-extension.
Set the port. This is a shortcut for convenience because you probably don't care about the difference between port and providedPort.
The fragment. In web documents, this typically refers to an anchor element. For instance, in the URL https://cnn.com/news/story/17774#header2, the fragment is "header2".
The hostname.
The password in this URL. Usually absent.
The path. This excludes the query string. For instance, in the URL https://cnn.com/news/story/17774?visited=false, the path is "/news/story/17774".
The port that was explicitly provided in the URL.
The query string elements. For instance, in the URL https://cnn.com/news/story/17774?visited=false, the query string elements will be ["visited": "false"]. Similarly, in the URL https://bbc.co.uk/news?item, the query string elements will be ["item": ""].
The URL scheme. For instance, ssh, ftp, or https.
The username in this URL. Usually absent. If present, there will also be a password.
A Unique Resource Locator.
The syntax for URLs is scheme:[//[user:password@]host[:port]][/]path[?query]fragment.