GetPowerServerURL
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
|
1 |
applicationname.GetPowerServerURL ( ) |
|
Argument |
Description |
|---|---|
|
applicationname |
The name of the application object from which you want to |
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:
|
1 2 |
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.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
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
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest