403:The request is understood, but it has been refused Twitter Android

我怕爱的太早我们不能终老 提交于 2019-12-05 00:51:32

I had this same error and upgrading to the latest version of twitter4j 3.0.5 (at the time of this writing) fixed the issue.

Get the latest here http://twitter4j.org/en/index.html#download

EDIT: I should mention that the version i was running was twitter4j 3.0.3. So by going to version 3.0.5 or 3.0.6 fixed the issue for me.

in

ConfigurationBuilder cb = new ConfigurationBuilder();

add cb.setUseSSL(true)

it will work

redirect url ssl required make sure your application running on https.

I encountered this error when I wanted to share an image with a wrong a url. Turned out I set the wrong folder in the url, Twitter didn't find the image thus throw an error. Question is, why do they show this error instead of something like "wrong url".

You may also run into this error when your are trying to post a longer text. I ran into this when I wanted to share a text (124 characters) and a link (10) characters and it didn't let me post it.

Found this problem again in the non-stable version 4.0.6.

Try not using maven in the way is specified in twitteer4j's website, which is this:

 <dependencies>
      <dependency>
           <groupId>org.twitter4j</groupId>
           <artifactId>twitter4j-core</artifactId>
           <version>[4.0,)</version>
       </dependency>
       ...
   </dependencies>

Instead, put an specific version (current stable is 4.0.4 and fix this problem, but [4.0,) gets the newest from 4.0, so 4.0.6)

 <dependencies>
      <dependency>
           <groupId>org.twitter4j</groupId>
           <artifactId>twitter4j-core</artifactId>
           <version>4.0.4</version>
       </dependency>
       ...
   </dependencies>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!