-
Notifications
You must be signed in to change notification settings - Fork 662
Open
Description
after usign it with get, it worked but when i wanted to use it with an api with post methode it therows error
this is my code
` const oauth = new OAuth.OAuth(
"https://api.twitter.com/oauth/request_token",
"https://api.twitter.com/oauth/access_token",
TWITTER_CONSUMER_KEY,
TWITTER_CONSUMER_SECRET,
"1.0A",
null,
"HMAC-SHA1"
);
oauth.post(
"https://api.twitter.com/2/tweets",
TWITTER_ACCESS_TOKEN, // user token
TWITTER_SECRET_TOKEN, // user secret
{ text: "hi" },
"application/json",
async function(e, data) {
if (e) console.log(e);
console.log(data);
});`
it return this error
{
statusCode: 400,
data: '{"errors":[{"parameters":{},"message":"Requests with bodies must have content-type of application/json."}],"title":"Invalid Request","detail":"One or more parameters to your request was invalid.","type":"https://api.twitter.com/2/problems/invalid-request"}'
}
Metadata
Metadata
Assignees
Labels
No labels