-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
post method throw error #364
Comments
@maychine-fatima Any update on this? Is it working for you now? I am also facing similar issue. FYR: https://twittercommunity.com/t/how-to-use-twitter-v2-apis/163669 |
Not sure if this issue is specific to node-oauth but using axios I was able to tweet using twitter v2 APIs. Working code snippet added for reference:
FYR: @maychine-fatima |
what's matter with the authors?Why don't resolve this issue? |
oh my god。this issue has been here for two years ~~ |
@maychine-fatima @aditodkar I fixed this problem with the following code: oauth.post(
`https://api.twitter.com/2/users/${twitterUserId}/following`,
accessToken,
accessTokenSecret,
JSON.stringify({ target_user_id: '1613090899432722432' }),
'application/json',
(err, result) => {
},
) |
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
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"}'
}
The text was updated successfully, but these errors were encountered: