Giter Club home page Giter Club logo

Comments (8)

geduldig avatar geduldig commented on June 10, 2024 1

I see one thing you are doing wrong. The 'tweets' request, by default uses HTTP GET. You need to use HTTP POST in order to upload a tweet. Try this...
r = api.request('tweets', {'text':'a test to test'}, method_override='POST')

from twitterapi.

geduldig avatar geduldig commented on June 10, 2024

Looks good to me. Are you using the same credentials with Postman and TwitterAPI?

I would add something to your code to confirm that your credentials are valid.

from twitterapi.

965realestate avatar 965realestate commented on June 10, 2024

Yes, I'm using the same exact credentials with Postman and TwitterAPI.

What code do I need to add that check my credentials are valid?

from twitterapi.

geduldig avatar geduldig commented on June 10, 2024

You could try other enpoints, such as searching for tweets, that don't require write privileges. I'm really not sure what to tell you. It doesn't make sense that the same credentials would would work in one case and not in the other. Are those credentials associated with a Twitter developer project?

from twitterapi.

geduldig avatar geduldig commented on June 10, 2024

The error you are receiving is from Twitter, so it's impossible to for me to look into the cause. There must be some difference between your requests in Postman and in TwitterAPI. It might be helpful to try the same request using another library such as twarc.

from twitterapi.

965realestate avatar 965realestate commented on June 10, 2024

I see one thing you are doing wrong. The 'tweets' request, by default uses HTTP GET. You need to use HTTP POST in order to upload a tweet. Try this... r = api.request('tweets', {'text':'a test to test'}, method_override='POST')

method_override='POST'

Thank you! Problem fixed

from twitterapi.

geduldig avatar geduldig commented on June 10, 2024

from twitterapi.

qkxie avatar qkxie commented on June 10, 2024

@geduldig

api = TwitterAPI(consumer_key, consumer_secret, access_key, access_secret, api_version='2')

from twitterapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.