0

这是我使用 RenderListDataAsStream 端点检索列表数据的 ajax 调用。

var payload = {
    'parameters': {
        RenderOptions: 2
    }
};
$.ajax({
    url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists(guid'<list-id>')/RenderListDataAsStream",
    type: "POST",
    headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'X-RequestDigest': $("#__REQUESTDIGEST").val() },
    body: JSON.stringify(payload),
    success: function (data) {
        console.log(data);
    },
    error: function (error) {
        alert(JSON.stringify(error));
    }
});

相同的代码在 SharePoint Online 中运行,但给出如下错误:

{"error":{"code":"-1, Microsoft.SharePoint.Client.ResourceNotFoundException","message":{"lang":"en-US","value":"找不到请求 RenderListDataAsStream 的资源."}}}

此问题仅在 SP2013 中特别存在。

4

1 回答 1

2

使用_api/$metadata您可以在您的场中找到可用的 rest api 函数,而根据我的检查,SharePoint 2013 中不存在 RenderListDataAsStream。

于 2020-02-21T02:11:39.727 回答