string.urlSplit

Syntax string.urlSplit (string)

Params string is a string containing a URL. The URL must be valid and complete, including the protocol, server, and path.

Action Splits the URL into three parts: the protocol, the server, and the path.

Returns A list, containing the protocol, server, and path parts of the URL, respectively.

Examples string.urlSplit ("http://www.yourserver.com/essays/97/04/myLife.html")

   » {"http://", "www.yourserver.com", "essays/97/04/myLife.html"}

Notes The returned path does not begin with a /, so be careful when translating the output of this verb into an HTTP request, whose path must start with a slash.

Discuss