I have a need to make a REST call from within Aware. (I am not really worried about the result, but this will allow me to do some "neat" stuff on my server. Before I re-invent things, wonder if anyone else has done this?
It looks like the best approach would be to use JQuery Ajax calls. I do need to use a different port (where my Node.JS server is listening.) Searching the web, I do see some CORS examples like:
$.ajax({
type: "PUT",
url: "http://localhost:8080/some/url/resource/path",
contentType: "application/json",
data: JSON.stringify({
name: "Tricia",
age: 37
}),
dataType: "text",
success: function( response ){
// Put the plain text in the PRE tag.
$( "#putResponse" ).text( response );
},
error: function( error ){
// Log any error.
console.log( "ERROR:", error );
},
complete: function(){
// When this completes, run someFunction
someFunction();
}
});
};
Does this make sense to you JQuery experts?
Thanks
Bruce