I have limited experience with API's and recently wrote a function to send data to an API. I have bound this function to a textbox text change event, but I am unsure if it is working since I am not receiving any errors. Below is the code for the function:
function sendAPIData(url,introduction,coordinateid){
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://192.168.51.212:3368/casigo/sDAGinput",true);
xhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
var input = JSON.stringify({
"coordinate": coordinateid,
"url": url,
"introduction": introduction
});
xhttp.send(input);
}
I expect this function to provide me with some input string.