Closed snovosel closed 3 years ago
For future reference, individual strings must be url encoded manually ie:
const twitterRequest = {
url: `https://api.twitter.com/1.1/statuses/update.json?status=${encodeURIComponent(
tweetText
)}`,
method: "POST"
};
This bit me over here which is using URLSearchParams.set() to build up a URL and its query parameters. This works great, but when the parameter value contains a space it gets encoded as a +
which causes oauth-1.0a to fail as described in this issue.
I am trying to post to the
statuses/update
route with the Twitter API.Using the same credentials, literally copied and pasted from the below console log and put into Postman, this route works and I am returned a 200 from Twitter.
However, using axios and the below function will return an error
code: 32, message: 'Could not authenticate you.'
. I don't believe this is an issue with the Twitter API as the credentials are working with Postman. Could anyone offer some insight on this?I am using the same package and package method to generate the access token and access secret in step 1 of the oauth handshake without a problem. The issues are arising when the access token and access token secret are present in the signing process.