I am trying to use the Twitter API to tweet, retweet, and upload images, while tweet works as intended, upload media don't work. more information below
packages i use :
node-fetch
deepmerge - to merge the given options
oauth-1.0a
crypto
the error appears at all the fetch request related to this function
Error:
{ errors: [ { code: 32, message: 'Could not authenticate you.' } ] }
I know whats the error is about, just asking this as I am confused why this would appear only in this function,as the auth info is correct and the same function used to create the headers work in another function
some important functions and related : https://hastebin.com/eyepikidax.kotlin
the code affected : https://hastebin.com/inehomodag.js
tweet function : (the working function) : https://hastebin.com/xatebakahe.properties
even though the tweet works with the same function _makeRequest
(custom function) uploadmedia dont
uploadmedia is same as tweet but with extra steps like uploading media
i logged the headers provided by _makeRequest
for the tweet function and the upload function
headers: https://hastebin.com/xojotupine.rust
it seems in the uploadmedia
function the headers became invalid but in the tweet function they are valid
question from:
https://stackoverflow.com/questions/65642758/could-not-authenticate-you-twitter-api-v1-1 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…