Has anyone successfully called the Azure Machine Learning webservice using JavaScript Ajax?
Azure ML provides sample code for C#, Python, and R, but I'm struggling with JQuery Ajax.
Despite my efforts, calling the webservice using JQuery Ajax results in a failure.
Interestingly, I have been able to call the same service using a python script.
Below is the Ajax code I've been using:
$.ajax({
url: webserviceurl,
type: "POST",
data: sampleData,
dataType:'jsonp',
headers: {
"Content-Type":"application/json",
"Authorization":"Bearer " + apiKey
},
success: function (data) {
console.log('Success');
},
error: function (data) {
console.log('Failure ' + data.statusText + " " + data.status);
},
});