【发布时间】:2017-06-21 15:52:35
【问题描述】:
我需要从服务器端本身不断调用 API,以便每秒 24/7 调用它。我怎样才能做到这一点?
我在 server.js 中尝试如下所示,但得到'TypeError:request.put is not a function'。
app.get('/',function(request,response){
setInterval(function(){
request.put('http://localhost:4242/changepaidstatus', function(error,response){
if (error){
console.log(error);
}
else{
console.log(response);
}
});
}, 1000);
});
【问题讨论】:
标签: javascript node.js express