Print Page as PDF
HTTP Client Helper ICR (5554)

HTTP Client Helper    ICR (5554)

Name Value
NUMBER 5554
IA # 5554
DATE CREATED 2010/08/24
CUSTODIAL PACKAGE TOOLKIT
USAGE Supported
TYPE Routine
DBIC APPROVAL STATUS APPROVED
ROUTINE XTHCURL
NAME HTTP Client Helper
GENERAL DESCRIPTION
These are some helper functions for the HTTP/1.1
Client.
STATUS Active
KEYWORDS
  • HTTP
  • HTML
DURATION Till Otherwise Agreed
ID XTHCURL
COMPONENT/ENTRY POINT
COMPONENT/ENTRY POINT COMPONENT DESCRIPTION VARIABLES
$$MAKEURL(host[,port][,path][,query])
Creates a URL from components.

Example:
S host="http://www.map.com"
S path="api/staticmap"
S query("center")="clay+st.,Oakland,CA"
S query("sensor")="false"
W $$MAKEURL^XTHCURL(host,,path,.query)
http://www.map.com/api/staticmap?center=clay%2Bst.%2COakland%2CCA&sensor=f
alse
VARIABLES TYPE VARIABLES DESCRIPTION
host Input
(Required) The FQDN or IP address of the system to
connect to.
port Input
(Optional) The port to use. Default is port xx for
http or port xxx for https.
path Input
(Optional) The path to the web page on the called
server.
query Input
(Optional) An array of query parameters.
returns Output

Success: Normalized path (see example above)
Fail: -1^Host not defined (if missing host variable)
$$ENCODE(str)
Encodes the query string. Used by MAKEURL.
Example:
W $$ENCODE^XTHCURL("1301+clay+st.,Oakland,CA")
1301%2Bclay%2Bst.%2COakland%2CCA
VARIABLES TYPE VARIABLES DESCRIPTION
str Input
(Required) String of data to be encoded.
returns Output
Success: Encoded query string Fail: -1^String not
defined (if missing str variable)
$$PARSEURL(url,.host,.port,.path)
Parses a URL string into host, port, and path (path
includes query string).
Example:
D PARSEURL^XTHCURL("http://url         :xxxx/tpl/PKG",.ZH,.ZP,.ZA)
W ZH,!,ZP,!,ZA
DNS
xxxx (port)
/tpl/PKG
VARIABLES TYPE VARIABLES DESCRIPTION
url Input
(Required) URL string to be parsed.
host Output
(Required) Reference to variable where host name is
to be returned.
port Output
(Required) Reference to variable where port is to be
returned.
path Output
(Required) Reference to variable where path string is
to be returned.
returns Output

Success: 0
Fail: -1^Error Description
DATE ACTIVATED 2015/06/26