Skip to content

Instantly share code, notes, and snippets.

@furkankaracan
Created November 2, 2022 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save furkankaracan/6c57afded2f154c5321f6792f1b23281 to your computer and use it in GitHub Desktop.
Save furkankaracan/6c57afded2f154c5321f6792f1b23281 to your computer and use it in GitHub Desktop.
function callFlow(flowURL) {
let parameter1 = "parameter1";
let parameter2 = "parameter2";
let body = {
"Parameter1": parameter1,
"Parameter2": parameter2
};
let req = new XMLHttpRequest();
req.open("POST", flowURL, true);
req.setRequestHeader("Content-Type", "application/json");
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
let resultJson = JSON.parse(this.response);
} else {
console.log(this.statusText);
}
}
};
req.send(JSON.stringify(body));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment