URL Parser
Break a URL into its parts and edit the query string as a list of key-value pairs rather than as one long line. Useful when a URL is long enough that finding the parameter you care about by reading is impractical.
This page opens in parse mode.
The parts, and which ones travel
Scheme, host, port, path, query and fragment each get their own field. The fragment is worth singling out: everything after # is stripped by the browser before the request is sent, so it never reaches the server. Anything you need server-side belongs in the path or query.
https://api.example.com:8443/v2/items?tag=a&tag=b#top
└─┬─┘ └──────┬───────┘└┬─┘└──┬──┘└────┬────┘└┬┘
scheme host port path query fragmentRepeated parameters are preserved
Nothing in the URL spec defines what ?tag=a&tag=b means, and frameworks disagree - some hand you the first value, some the last, some an array. Duplicates are kept visible and in order here rather than silently collapsed, so you can see exactly what a server will receive.
Case sensitivity is not uniform
Scheme and host are case-insensitive; path, query and fragment are not. So HTTPS://EXAMPLE.COM/Path and https://example.com/Path are the same URL, while changing Path to path may well be a different resource.
Relative URLs need a base
A path on its own is not a URL and cannot be parsed into host and scheme without knowing what it is relative to. Resolution against a base is a separate step, and the rules for how .. and a leading slash behave are less obvious than they look.
Supply the absolute form when you want a full breakdown.