使用sharepoint 2013中的REST API从外部列表中获取数据

编程入门 行业动态 更新时间:2024-10-26 04:26:30
本文介绍了使用sharepoint 2013中的REST API从外部列表中获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用SharePoint 2013中的REST API从外部列表中获取列表项。下面是外部URL: http:// mrutyunjaya / _layouts / 15 / start.aspx#/ Lists / Tool%20Max%20Time / Read%20List.aspx 我正在尝试使用REST API从此列表中检索数据。下面是到目前为止编写的代码:

I am trying get list items from an external list using REST API in SharePoint 2013. Below is the external URL: mrutyunjaya/_layouts/15/start.aspx#/Lists/Tool%20Max%20Time/Read%20List.aspx I am trying to retrieve data from this list using REST API. Below is the code written so far:

var app = angular.module('EatonScanningApp');

app.factory("EatonScanningFactory", ['$http', function($http) { var EatonScanningFactoryObj = {};

EatonScanningFactoryObj.GetToolMaxTimeList = function () { return $http({ method: 'GET', url: "psmi-dev3/_api/lists/getbytitle('Tool%20Max%20Time')/items", headers: { "Accept": "application/json;odata=verbose" } }); }

}]); 我正在尝试访问上述休息服务下面的代码,但我无法获得存储在$ scope.list中的外部列表长度的正确输出,如下所示:

}]); I am trying to access the above rest service in the below code but I am unable to get proper output for the length of the external list which is stored into $scope.list as shown below:

$scope.list = EatonScanningFactory.GetToolMaxTimeList();

console.log($($scope.list.length));

请帮助 我尝试过:

Please help What I have tried:

var app = angular.module('EatonScanningApp');

app.factory("EatonScanningFactory", ['$http', function($http) { var EatonScanningFactoryObj = {};

EatonScanningFactoryObj.GetToolMaxTimeList = function () { return $http({ method: 'GET', url: "psmi-dev3/_api/lists/getbytitle('Tool%20Max%20Time')/items", headers: { "Accept": "application/json;odata=verbose" } }); }

}]);

}]);

推荐答案

http', function (

http){ var EatonScanningFactoryObj = {}; http) { var EatonScanningFactoryObj = {};

EatonScanningFactoryObj.GetToolMaxTimeList = function () { return

http({ method:' GET', url: http:// psmi-dev3 / _api / lists / getbytitle('Tool%20Max%20Time')/ items, header :{ 接受: application / json; odata = verbose} }); } http({ method: 'GET', url: "psmi-dev3/_api/lists/getbytitle('Tool%20Max%20Time')/items", headers: { "Accept": "application/json;odata=verbose" } }); }

}]); 我正在尝试访问上述休息服务下面的代码,但我无法获得外部列表长度的正确输出,存储到

}]); I am trying to access the above rest service in the below code but I am unable to get proper output for the length of the external list which is stored into

更多推荐

使用sharepoint 2013中的REST API从外部列表中获取数据

本文发布于:2023-10-29 13:01:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539763.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   列表中   sharepoint   API   REST

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!