Can I use Javascript call the Azure management REST API?

后端 未结 1 349
灰色年华
灰色年华 2021-01-27 01:50

I want to use Azure Table storage REST api in javaScript. So I make call like this:

 $.ajax({
        type: \"POST\",

        beforeSend: function (request)
            


        
相关标签:
1条回答
  • 2021-01-27 02:06

    Currently you can't call Azure Management API directly using JavaScript because CORS is not supported in Windows Azure. Support for CORS is coming soon in Windows Azure Storage. Apart from CORS, Windows Azure Table Storage will also support returning the data in JSON format. Once those 2 things are in place, you should be able to accomplish this.

    For now you would need to rely on some kind of middle layer (either as a Windows Azure Cloud service or a Windows Azure Websites) to which you'll send requests through your JavaScript application and then this middle layer will interact with the storage to get the data. Since Windows Azure Table Storage only returns the data in XML format, you would then convert that data into JSONP format and return back to the client.

    0 讨论(0)
提交回复
热议问题