The new OpenUrl system function has the same functionality as the HyperLinkToURL function of the Inet object.
Integer OpenUrl( string url )
With the introduction of OpenUrl, it is possible to completely remove the obsolete Inet object.
-
The OpenUrl function replaces the Inet.HyperLinkToURL function, to open the default Web browser (outside the application) and display the specified URL.
-
The HTTPClient.SendRequest ("GET", ...) replaces the Inet.GetURL function.
For example,
Integer li_rc String ls_string HttpClient lnv_HttpClient lnv_HttpClient = Create HttpClient // Sends request using GET method li_rc = lnv_HttpClient.SendRequest("GET", "https://demo.appeon.com/PB/webapi_client/employee/102") // Obtains the response data if li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 then lnv_HttpClient.GetResponseBody(ls_string) end if
-
The HTTPClient.SendRequest ("POST", ...) replaces the Inet.PostURL function.
For example,
Integer li_rc String ls_ReturnJson HttpClient lnv_HttpClient lnv_HttpClient = Create HttpClient String 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 data if li_rc = 1 and lnv_HttpClient.GetResponseStatusCode() = 200 then lnv_HttpClient.GetResponseBody(ls_ReturnJson) end if