Construct - Maple Help

URL

 Construct
 construct a URL from its components

 Calling Sequence Construct( componentTable, component1, component2, ... )

Parameters

 componentTable - a table of component/value pairs. The components should be specified as a string. component - an equation specifying a component to be added to the constructed URL

Description

 • Construct builds a URL string of the given components.
 • The URL will be of the form: scheme://user:password@host:port/urlpath?query#anchor
 • The following components are supported:
 – scheme=string The protocol to be used.  The default is http.
 – user=string The username to be used.  The default is none.
 – host=string The host portion.  This component is required.
 – port=integer The port on the host to connect to.  The default is none.
 – urlpath=string The path on the host to access.  The default is /.
 – query=list(string,equation) Query data to be added to the URL.  The default is none.
 – anchor=string An anchor to add to the URL.  The default is none.
 • These components can be specified as parameters or a table of component/value pairs.  A component specified as a parameter will override one specified in a table.
 • The Parse method performs the reverse operation, splitting a given URL into a table of components.

Examples

 > $\mathrm{URL}:-\mathrm{Construct}\left(\mathrm{scheme}="scheme",\mathrm{user}="user",\mathrm{password}="password",\mathrm{host}="host",\mathrm{port}=1234,\mathrm{urlpath}="urlpath",\mathrm{query}=\left["query"\right],\mathrm{anchor}="anchor"\right)$
 ${"scheme://user:password@host:1234/urlpath?query#anchor"}$ (1)
 > $\mathrm{URL}:-\mathrm{Construct}\left(\mathrm{table}\left(\left["scheme"="scheme","user"="user","password"="password","host"="host","port"=1234,"urlpath"="urlpath","query"=\left["query"\right],"anchor"="anchor"\right]\right)\right)$
 ${"scheme://user:password@host:1234/urlpath?query#anchor"}$ (2)
 > $\mathrm{URL}:-\mathrm{Construct}\left(\mathrm{scheme}="http",\mathrm{host}="www.maplesoft.com"\right)$
 ${"http://www.maplesoft.com/"}$ (3)
 References

Compatibility

 • The URL[Construct] command was introduced in Maple 18.