Giter Site home page Giter Site logo

Comments (5)

douglascorrea avatar douglascorrea commented on June 21, 2024

I saw that oauth.io update home page and received newsletter about new features and so on. It means these issue will be considered? (At least some feedback about)?

from oauth-js.

thyb avatar thyb commented on June 21, 2024

The issue is the endpoint you call is on upload.twitter.com while oauth.io is actually making a call to api.twitter.com when you're giving a relative endpoint.

You can try with this:

r.post('https://upload.twitter.com/1.1/media/upload.json', { 
   data: {
       media_data: imgBase64
   }
})

btw, note that if you're using base64 file to upload, you need to use media_data and not media which is used for raw data file.

I got normal response using this:

{"media_id":667134289646133248,"media_id_string":"667134289646133248","size":793,"expires_after_secs":86400,"image":{"image_type":"image\/png","w":16,"h":16}}

from oauth-js.

dlittle42 avatar dlittle42 commented on June 21, 2024

I'm trying to upload media to twitter as well. I tried using this endpoint, but I keep getting this error:

XMLHttpRequest cannot load https://oauth.io/request/twitter/%2F1.1%2Fmedia%2Fupload.json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 413.

from oauth-js.

JeffGreat avatar JeffGreat commented on June 21, 2024

I'm having the same response status 413. My file is a bit more than 1Mo. It works with a smaller file. I dont understand why the request is too long since the Twitter Api documentation is talking about 5Mo limitation.

from oauth-js.

JeffGreat avatar JeffGreat commented on June 21, 2024

The chunk method is prefered by twitter. Therefore I've finally adapted my code and it works thanks to this code I adapted:
https://github.com/jambonsw/twitter-media-upload-split-error-mve/blob/gh-pages/main.js#L110

If you need more info let me know.

from oauth-js.

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.