HttpRequest examples for the open("GET") method
This type of the communication can be quite time consuming, depending on the volume of transmitted data connectivity performance. Such delays may have negative impact on the application itself. Therefore it is recommended to call the communication from a properly configured
PmaSequencer object.
Getting the text from a secured server by communication with personal certificate.:
The personal certificate must be properly registered on the client computer. Its registered name is used by the
setOption method for server authentication. The row in the comment also provides the option to ignore the certificate authentication request from the server. This can be handy if the certificate is no longer valid or if the authentication is not required by the server.
JavaScriptSelect and copy to clipboard
var oReq, sUrl, sCert;
var sCert = "My personal certificate";
var sUrl = "https://www.promotic.eu/test/data/getewon.txt";
var oReq = Pm.AxGetObject("new", "MSXML2.ServerXMLHTTP.6.0");
oReq.open("GET", sUrl, false);
oReq.setRequestHeader("Content-Type", "text/plain; charset=utf-8");
oReq.setOption(3, sCert);
// oReq.setOption(2, oReq.getOption(2));
oReq.onreadystatechange = HandleStateChange;
oReq.send();
function HandleStateChange()
{
if (oReq.readyState == 4)
{
Pm.MessageBox("Text", oReq.responseText, 0x0);
}
}