【发布时间】:2012-12-06 10:47:49
【问题描述】:
尝试从 nodejs 访问 SharePoint 时出现以下错误
events.js:71 抛出参数[1]; // 未处理的“错误”事件 ^ 错误:连接 ECONNREFUSED 在 errnoException (net.js:769:11) 在 Object.afterConnect [as oncomplete] (net.js:760:19)
下面是代码
var SP = require('sharepoint'),
site = //url,
username = //username,
password = //password;
var client = new SP.RestService(site),
contacts = client.list('Contacts');
var showResponse = function (err, data) {
console.log(data);
}
client.signin(username, password, function () {
// At this point, authentication is complete,
// so we can do requests.
// Example request: Get list items
// showResponse is used as callback function
contacts.get(showResponse)
});
【问题讨论】:
标签: node.js sharepoint