开发者

Host is unresolved: api.twitter.com:80

开发者 https://www.devze.com 2023-03-01 16:00 出处:网络
I am implementing twitter for android.When i am requesting for Request Token.It throws me this error:

I am implementing twitter for android. When i am requesting for Request Token. It throws me this error:

04-27 11:25:01.开发者_StackOverflow社区163: DEBUG/ERROR=(3467): Host is unresolved: api.twitter.com:80

Before it was working fine. Suddenly it started giving this error.

Thanks in advance, aby


That sounds like a DNS lookup error. If you have a network tool suite installed that allows nameserver lookups (GTech Net Tools is one of these, and it's free) try entering api.twitter.com to see if your emulator can resolve the IP address.

One other thing to note is that you should be using HTTPS to call the OAuth resources at Twitter. From the :80 on your request, you can tell that whatever called oauth/request_token used plain old HTTP. All network communication involved in negotiating your OAuth tokens should be secured.


I understand that we can use HTTP as well(If your system lacks a security cert). You can tell the library to use HTTP call by adding the following line before the initializing the Twitter connection object.

System.setProperty("twitter4j.http.useSSL","false");


I had the same problem and after many tries it seems that the problem was in the emulator.. when trying the program on 1.5 it worked. However, it didn't work on 2.1. I opened the native emulator browser on 2.1 and it failed to load the google page (probably the emulator got an internet connection problem)

0

精彩评论

暂无评论...
验证码 换一张
取 消