URLBuild

URLBuild["path",{"param1"val1,"param2"val2,}]

builds a URL with the specified path and query parameters and values parami and vali.

URLBuild[{"path1","path2",}]

builds a URL from the path components pathi.

URLBuild[path,params]

builds a URL from a specification of a path and query parameters.

URLBuild[assoc]

builds a URL from an association of components.

URLBuild[assoc,params]

builds a URL from an association of components, plus query parameters and values.

Details and Options

  • URLBuild[URL["path"],] and URLBuild[CloudObject["path"],] are also supported.
  • In a list of rules for queries, the vali can be strings or numbers, or the following special forms:
  • None,Null,Missing""
    True"true"
    False"false"
    {e1,e2,}e1, e2,
  • In URLBuild[assoc], the Association assoc can contain the following elements:
  • "Scheme"URL scheme
    "User"user information
    "Domain"domain name or host
    "Port"port number (as an integer)
    "Path"path list or string
    "Query"query string or list of parameter-value pairs
    "Fragment"fragment specification (given after #)
  • If queries are specified both in assoc and with a list of rules, the queries are concatenated.
  • Strings from assoc or from query parameters or values are percent-encoded.
  • URLBuild has the option CharacterEncoding, which specifies what type of character encoding to use for the output. The default is "UTF-8".

Examples

open allclose all

Basic Examples  (3)

Build a URL:

In[1]:=
Click for copyable input
Out[1]=

Include a query:

In[1]:=
Click for copyable input
Out[1]=

Create a URL string from an association:

In[1]:=
Click for copyable input
Out[1]=

Scope  (6)

Generalizations & Extensions  (1)

Options  (3)

Applications  (1)

Properties & Relations  (1)

Possible Issues  (1)

See Also

URLQueryEncode  URLParse  URLEncode  SystemOpen  FileNameJoin  Hyperlink  HTTPRedirect  $CloudBase  $UserURLBase

Introduced in 2014
(10.0)
| Updated in 2016
(11.0)