我通过AJAX调用列表如下:
var url = "https://mysite-public.sharepoint.com";
url: url + "/_api/web/lists/getbytitle('mylist')/items",
method: "GET",
headers: { "Accept": "application/json; odata=verbose"
},
success: function (data) {
completeMenu(data, target);
},
error: function (data) {
failureMenu(data, target);
}
});
}
因此,在私人网站中,我可以毫无问题地访问列表。问题是在具有匿名访问权限的公共站点中,我收到以下错误:
<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<m:code>-2147024891, System.UnauthorizedAccessException</m:code>
<m:message xml:lang="es-EN">
You don´t have necessary permissions to do this action or access to recourse
</m:message>
</m:error>
我真的很感激帮助。此致