Description
Gets the root URL of the PowerServer Web APIs, for example, https://172.16.100.71:5099.
This function is only effective in the installable cloud application deployed with PowerServer.
Applies to
Syntax
applicationname.GetPowerServerURL ( )
Argument |
Description |
---|---|
applicationname |
The name of the application object from which you want to get the PowerServer root URL |
Return value
String.
Returns the root URL of the PowerServer Web APIs if it succeeds and an empty string if the current application is not an installable cloud app deployed with PowerServer.
Examples
The following code example gets the PowerServer root URL:
String ls_ServerURL ls_ServerURL = GetApplication().GetPowerServerURL() //gets the root URL, e.g. http://172.25.100.32:5000
The following code example calls the PowerServer GetSessionCount API to get the session count.
String ls_ServerURL, ls_SessionAPI, ls_Body Integer li_rc HttpClient lhc_client ls_ServerURL = GetApplication().GetPowerServerURL() //gets the root URL, e.g. http://172.25.100.32:5000 ls_SessionAPI = ls_ServerURL + "/api/session/getsessioncount" //formulates the GetSessionCount API, e.g. http://172.25.100.32:5000/api/Session/GetSessionCount lhc_client = Create HttpClient lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true) li_rc = lhc_client.sendrequest("get", ls_SessionAPI) if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then lhc_client.getresponsebody(ls_body) end if
See also