Node.js 我如何在nodejs中保持betfair会话的活动
我已经为betfair编写了一个nodejs应用程序,但是我的会话id即将过期,我无法确定如何编写保持活动的代码。这是它的文档:我找到了一个解决方案。我已在此网站上转换了curl命令: 这是我的代码:Node.js 我如何在nodejs中保持betfair会话的活动,node.js,Node.js,我已经为betfair编写了一个nodejs应用程序,但是我的会话id即将过期,我无法确定如何编写保持活动的代码。这是它的文档:我找到了一个解决方案。我已在此网站上转换了curl命令: 这是我的代码: var request = require('request'); var appkey = xxxx; var ssid = xxxx; function keepAlive() { var options = { url: 'https://identitysso.
var request = require('request');
var appkey = xxxx;
var ssid = xxxx;
function keepAlive() {
var options = {
url: 'https://identitysso.betfair.com/api/keepAlive',
headers: {
'Accept': 'application/json',
'X-Application': appkey,
'X-Authentication': ssid
}
};
function callback(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
}
request(options, callback);
}
请分享您收到的错误的详细信息以及您编写的一些代码。