I want to use Azure Table storage REST api in javaScript. So I make call like this:
$.ajax({
type: "POST",
beforeSend: function (request)
{
request.setRequestHeader("contentType", "application/atom+xml;type=entry;charset=utf-8");
},
url: "http://mystorageaccountname.table.core.windows.net/TodoList()?sv=2012-02-12&se=2013-07-05T09%3A40%3A06Z&tn=Todo&sp=raud&spk=myid&epk=myid&sig=Z%2BrfC2HxxxBUqM3nt6sCjlSvttb6qqOY%2BBnbdPYV%2BzliA%3D&timeout=90",
contentType: "application/atom+xml",
dataType: "jsonp",
jsonpCallback:"jsonpCallback",
data: xmlString,
success: function (xhr) {
alert(xhr.statusCode);
}
});
I found the request type convert to get because jsonp not support post.. Then I found this threads:
How to upload a text string directly to Windows Azure Blob from the browser using javascript Accessing Windows Azure Queues from client side javascript/jquery
seems like if I host the webrole and tablestorage service with the same domain, I can use that code with datatype=xml.
How can I do that? Does akakin.appcloudapp.net akakin.table.core.windows.net is same domain? Or how can I use JS/JQuery call Azure mangement Rest API directly?