URL Functions
scop.url.changepath(url,newpath)
Changes the path of an URL
returns: string
> = scop.url.changepath('http://lua.org/index.lp','/demo/index.lp') http://lua.org/demo/index.lp
Combines a path to a URL
returns: string
> = scop.url.combine('http://lua.org/demo/index.lp','test.lp') http://lua.org/demo/test.lp
Returns the main components of an URL as a table
returns: table
fileext - filename extension (eg: .lp)
filename - filename (eg: index.lp)
host - host name (eg: www.lua.org)
path - location (eg: /demo/index.lp)
port - port number (eg: 80)
proto - protocol (eg: https)
Decodes an URL
returns: string
Encodes an URL
returns: string
Full URL Encode
returns: string
> = scop.url.encodefull('/index.lp') %2F%69%6E%64%65%78%2E%6C%70
Generates an URL from a hostname and a port
returns: string
> = scop.url.genfromhost('www.lua.org',80) http://www.lua.org/ > = scop.url.genfromhost('www.lua.org',443) https://www.lua.org/
Extracts the extension from an URL filename
returns: string
scop.url.getfileext('http://host/path/index.lp') .lp
Extracts the URL filename
returns: string
> = scop.url.getfilename('http://host/path/index.lp') index.lp