New OpenURL function
The new OpenURL
system function has the same functionality as the HyperLinkToURL
function of the Inet object.
|
1 |
Integer OpenUrl( string url ) |
It is possible to completely stop using the obsolete Inet
object, because:
-
The OpenURL function can replace
the Inet.HyperLinkToURL function to open the default Web browser
(outside the application) and navigate to the specified
URL. -
The HTTPClient.SendRequest (“GET”, …) can replace the
Inet.GetURL function.For example,
1234567891011Integer li_rcString ls_stringHttpClient lnv_HttpClientlnv_HttpClient = Create HttpClient// Sends request using GET methodli_rc = lnv_HttpClient.SendRequest("GET", "https://demo.appeon.com/PB/webapi_client/employee/102")// Obtains the response dataif li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 thenlnv_HttpClient.GetResponseBody(ls_string)end if -
The HTTPClient.SendRequest (“POST”, …) can replace the
Inet.PostURL function.For example,
123456789101112131415161718Integer li_rcString ls_ReturnJsonHttpClient lnv_HttpClientlnv_HttpClient = Create HttpClientString ls_json = '{"empId":100, "fname":" John", "lname": "Guevara"}'// Constructs a POST request (supports all headers)lnv_HttpClient.SetRequestHeader("Content-Type", "application/json;charset=UTF-8")// Content-Length header set by SendRequest// Sends request using POST method (to add the string data to the body and set to the Content-Length header)li_rc = lnv_HttpClient.SendRequest("POST", "https://demo.appeon.com/PB/webapi_client/employee", ls_json)// Obtains the response dataif li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 thenlnv_HttpClient.GetResponseBody(ls_ReturnJson)end if
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest