Kernel Toolkit 7.3 APIs Banner
Office of Information and Technology (OIT) Banner
[skip navigation]

$$MAKEURL^XTHCURL(): Creates a URL from Components

Reference Type: Supported, Category: Toolkit—HTTP Client Helper, ICR#: 5554

Description

The $$MAKEURL^XTHCURL extrinsic function creates a URL from components.

NOTE: XTHC* routines are part of the HTTP Client Helper application for developers.

NOTE: This API is IPv6 compliant as of Kernel Toolkit patch XT*7.3*138.

NOTE: This API was released with Kernel Toolkit Patch XT*7.3*123.

Format

  $$MAKEURL^XTHCURL(host[,port][,path][,.query])

Input Parameters

host:

(required) The Fully Qualified Domain Name (FQDN) or Internet Protocol (IP) address of the system to which it connects.

port:

(optional) The port to use. Default is:

  • HTTP—Port 80

  • HTTPS—Port 443
path:

(optional) The path to the Web page on the called server.

.query:

(optional) An array of query parameters.

Output

returns:

Returns:

  • Success: Normalized path (see Example).

  • Fail: -1^Host not defined (if missing host parameter).

 

Example:

     S host="http://www.map.com" 
     S path="api/staticmap" 
     S query("center")="main+st.,Anycity,CA" 
     S query("sensor")="false" 
     W $$MAKEURL^XTHCURL(host,,path,.query)
      
     http://www.map.com/api/staticmap?center=main%2Bst.%2CAnycity%2CCA&sensor=false