ns_parseurl - Parse a URL into its components
This function parses the provided URL into its parts and returns these in the form of a Tcl dict. The function supports IP-literal notation as specified in RFC 3986.
The provided url might be an absolute URL (containing protocol and host), a protocol agnostic URL (starting with two slashes followed by hostname, as defined in RFC 3986) or a relative url (without location).
The resulting dict might contain the following elements: proto, host, port, path, and tail.
% ns_parseurl http://openacs.org//projects/openacs/download/ proto http host openacs.org path /projects/openacs/download tail {} % ns_parseurl {http://[::1]:80/index.html} proto http host ::1 port 80 path {} tail index.html % ns_parseurl /foo/bar.html path foo tail bar.html