Node.js 为Twitter API生成Oauth签名
听从 我正在尝试生成oauth_签名。这样我就可以打电话找到合适的代币了 (唯一的区别是我用以下公式生成nonceNode.js 为Twitter API生成Oauth签名,node.js,twitter,Node.js,Twitter,听从 我正在尝试生成oauth_签名。这样我就可以打电话找到合适的代币了 (唯一的区别是我用以下公式生成nonce let oauth_nonce = crypto.randomBytes(32).toString('base64'); oauth_nonce = oauth_nonce.replace(/[^\w\s]/gi, ''); 使用Axis在我经过的节点中进行调用 'Authorization':`OAuth-OAuth\u consumer\u k
let oauth_nonce = crypto.randomBytes(32).toString('base64');
oauth_nonce = oauth_nonce.replace(/[^\w\s]/gi, '');
使用Axis在我经过的节点中进行调用
'Authorization':`OAuth-OAuth\u consumer\u key=“${this.options.apiKey}”、OAuth\u-signature\u-method=“HMAC-SHA1”、OAuth\u-timestamp=“${parameters.OAuth\u-timestamp}”、OAuth\u-nonce=“${parameters.OAuth\u-nonce}”、OAuth\u-version=“1.0”、OAuth\u-signature=“${encoded\u-OAuth\u-signature
进入配置头选项
调用错误声明需要身份验证。Console.logging标头错误显示以下内容
{ Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/x-www-form-urlencoded',
Authorization:
'OAuth oauth_consumer_key="{{keyFromTwitterDevPage}}",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1599130958",oauth_nonce="FAUhXRqGcf3Dwg3JyWBPCHvDbDrIWnuCcHBJnPi0",oauth_version="1.0",oauth_signature="rs3Y4gdCeuTMp0RvQVSoidmhplY%3D"',
'User-Agent': 'axios/0.20.0' },
```
Just wondering if I've followed the steps incorrectly (copy the axois call from Postman) Which using my Consumer Key and Consumer Secret (used those values in the location from the medium article)