Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Azure by (45.3k points)

I wanted to know if there is a way to call the Azure Machine Learning webservice using JavaScript Ajax.

The Azure ML gives sample code for C#, Python and R.

I did try out to call the webservice using JQuery Ajax but it returns a failure.

I am able to call the same service using a python script.

Here is my Ajax code :

$.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);

        },

  });

1 Answer

0 votes
by (16.8k points)

You can  wrap your Azure ML webservice on Azure API is one option.

But, what I did was that I created a python webservice which calls the Azure webservice.

So now my HTML App calls the python webservice which calls Azure ML and returns data to the HTML App.

Related questions

Browse Categories

...