You are here: Network API
Network API
The Network API provides functions for network calls via HTTPÂ or HTTPS. The Network API enables your app to request data from remote sources, such as your data servers, over the Internet. In also enables you to validate that the data requests and the responses have not been tampered with as they traveled between the client app and the server. The Network API comprises of the following modules:
The Network API uses the voltmx.net Namespace
and the following API elements
Function | Description |
---|---|
voltmx.net.cancel | cancels only async network calls. Synchronous calls have a platform-specific cancellation mechanism provided by the platform |
voltmx.net.clearCookies | Removes cookies from the client that are associated with the specified domain. |
voltmx.net.FormData | Call this function to create a FormData object. |
voltmx.net.getActiveNetworkType | Retrieves the currently-active network type. |
voltmx.net.getCookies | Retrieves cookies associated with the specified domain. |
voltmx.net.hasCapablity | Determines whether the device has the specified capability. |
voltmx.net.HttpRequest | Creates an HttpRequest object. |
voltmx.net.isNetworkAvailable | Enables you to check whether a network is available for data transport on a device. |
voltmx.net.loadClientCertificate | Sets a client certificate to be used for HTTPS client authentication. |
voltmx.net.mfintegrationsecureinvokerasync | Invokes a Volt MX Foundry service asynchronously. |
voltmx.net.removeClientCertificate | Removes already loaded client certificate. |
voltmx.net.removeAllCachedResponses | Clears the default cache of an application by removing all responses received from URLs. |
voltmx.net.removeIntegrityCheck | Disables intregity checks for HTTP calls between the client and the server. |
voltmx.net.set5GNetworkListener | Determines if the device has a 5G network connection to the app. |
voltmx.net.setCookies | Adds cookies, or replaces an existing cookie in the cookie storage. |
voltmx.net.setIntegrityCheck | Enables the addition of checksums to HTTP calls for HTTP integrity checking. |
voltmx.net.setNetworkCallbacks | Allows the developer to register for network status changes. |
voltmx.net.setResponse | Sets a callback function that handles network events. |
voltmx.net.unregister5GNetworkListener | Unregister from the 5G Network Listener. |
voltmx.net.urlDecode | Converts a URL string from application/x-www-form-urlencoded format in the UTF-8 encoding. |
voltmx.net.urlEncode | Converts a URL string into application/x-www-form-urlencoded format using the UTF-8 encoding. |
To verify the identity of the server and establish a secure network connection through HTTPS, use the voltmx.net.loadClientCertificate function. A client certificate for HTTPS client authentication is set. You can remove the client certificate by using the voltmx.net.removeClientCertificate function.
To start with establishling a connection using HTTP, create an Http request object by using the voltmx.net.HttpRequest function. After creating an object, invoke a required Volt MX Foundry service by using the voltmx.net.mfintegrationsecureinvokerasync function. Then use the voltmx.net.setIntegrityCheck function to validate HTTP messages passing between the client app and the servers. To disable the HTTP integrity checking, use the voltmx.net.removeIntegrityCheck function.
Further, a URLs can be sent over the internet in ASCII format only. To convert a URL into valid ASCII format, use the voltmx.net.urlEncode function. Then use the voltmx.net.urlDecode function to convert the ASCII characters to readable format.
Please note that the voltmx.net.invokeServiceAsync
and voltmx.net.invokeservice
are deprecated and should not be used in new software. However, documentation for them is still available to help with the maintenance of legacy software.
Note: From V9 SP2 onwards, for etag caching of Network APIs, the data in a Volt MX App child app is stored in child app data and not under the parent app. This feature is applicable for iOS, Windows, and Android platforms.