【问题标题】:How to retreive ListItem using "RenderListDataAsStream" endpoint in SharePoint 2013如何在 SharePoint 2013 中使用“RenderListDataAsStream”端点检索 ListItem
【发布时间】:2020-06-04 20:26:45
【问题描述】:

这是我使用 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 中运行,但给出如下错误:

{"错误":{"代码":"-1, Microsoft.SharePoint.Client.ResourceNotFoundException","message":{"lang":"en-US","value":"不能 为请求 RenderListDataAsStream 查找资源。"}}}

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

【问题讨论】:

    标签: sharepoint sharepoint-2013 sharepoint-rest-api


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-07-24
      • 1970-01-01
      • 2013-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-01
      相关资源
      最近更新 更多