使用sharepoint 2013中的REST API从外部列表中获取数据 [英] Get data from an external list using REST API in sharepoint 2013

查看:153
本文介绍了使用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:

http://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: "http://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: "http://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 :{ 接受 < span class =code-string> application / json; odata = verbose}

});
}
http({ method: 'GET', url: "http://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从外部列表中获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆