Node.js &引用;“无法验证您的身份”;在友谊期间/使用twit npm包创建
我有一个NodeJS应用程序,通过库与Twitter交互。我在应用程序中同时使用了流媒体和RESTAPI。流媒体很好用,有些人也打电话给其他人,但出于某种原因Node.js &引用;“无法验证您的身份”;在友谊期间/使用twit npm包创建,node.js,twitter,Node.js,Twitter,我有一个NodeJS应用程序,通过库与Twitter交互。我在应用程序中同时使用了流媒体和RESTAPI。流媒体很好用,有些人也打电话给其他人,但出于某种原因 twit.post('friendships/create', { screen_name: tweet.user.screen_name, follow: false }, function (err, resp) { if (err) { return console.log
twit.post('friendships/create', {
screen_name: tweet.user.screen_name,
follow: false
}, function (err, resp) {
if (err) {
return console.log('friendship gave error: ' + JSON.stringify(err));
}
console.log('friended');
});
始终返回一个错误:
friendship gave error: {"message":"Could not authenticate you","statusCode":401,"code":32,"allErrors":[{"message":"Could not authenticate you","code":32}],"twitterReply":"{\"errors\":[{\"message\":\"Could not authenticate you\",\"code\":32}]}"}
我非常确定我的身份验证是正确的,否则其他对twitter的调用将无法工作。。。有什么想法吗
谢谢!
尼克。发现了问题:
twit库未正确处理布尔值作为调用参数:
我变了
```
跟随:假
``
到
跟随:“假”
问题解决了
尼克