问题描述
如何在Node.js中为Twitter API生成oauth_signature?我在孔洞日苦苦挣扎,但仍然无法正常工作。下面给出了我的代码,其中显示了错误的身份验证数据。
axios.post('https://api.twitter.com/1.1/statuses/update.json',querystring.stringify({
include_entities: true,oauth_consumer_key: twConfig.apiKey,oauth_nonce: cryptoRandomString({ length: 32,type: 'base64' }),oauth_signature_method: 'HMAC-SHA1',oauth_timestamp: new Date().getTime(),oauth_version: '1.0'
})).then(response => {
console.log(response);
res.send(response.data);
}).catch(err => {
console.log(err.response.data);
res.send(err.response.data);
}).then(() => { });
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)