I am trying to execute a HTTPXML request to push data via API from a PDF to a HCL LEAP platform. This code is set to run on Javascript via button click with the PDF. All relevant fields on the PDF are set as variables. The code works when ran within
I am trying to execute a HTTPXML request to push data via API from a PDF to a HCL LEAP platform. This code is set to run on Javascript via button click with the PDF. All relevant fields on the PDF are set as variables. The code works when ran within a browser. I am stuck on how to get the PDF to open a HTTP handler to perform the function.
var jp = {};
jp.flowState = 'ST_PendingPDFupload';
jp.pressedbutton = 'S_Submit1';
jp.F_CAC = this.getField("F_CAC").value.toString()
var s = JSON.stringify(jp); //covert to string to send in XHR
var UID = this.getField("UID").value.toString();
var urla = 'https://domain/forms-basic/secure/org/data/ba48a093-5a1d-
40ef-87f6-bb196b95fa9f/F_NewForm1/'
var urlb = 'freedomIdentifyKey=00'
var url = (urla + UID + urlb)
var client= new XMLHttpRequest(); //open an HTTP request
client.open("PUT",url,false);
client.setRequestHeader('Content-Type', 'application/json');
client.setRequestHeader('Accept', 'application/json');
client.setRequestHeader('Cookie', 'freedomIdentifyKey=00');
client.send(s);
