Explore Courses Blog Tutorials Interview Questions
0 votes
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 :


        url: webserviceurl,

        type: "POST",           

        data: sampleData,            


        headers: {


        "Authorization":"Bearer " + apiKey                       


        success: function (data) {



        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