URL Parser

Spread the love

{{ errors[0] }}

URL Parts

Syntax of a URL

If we have the URL:


The user info part is username:password, which has the username and password.

The hostname is www.secured.com.

The port number is 443

The path is /resource.html.

The query string is id=6e8bc430-9c3a-11d9-9669-0800200c9a66.

And the hash is #some-header

A URL can also have a user name and password. For instance, if we have:


The the username is username and password is password.