热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

TwitterExampledoesn'twork

Itshowsmethoselinesintheconsole:

It shows me those lines in the console:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
=== Twitter's OAuth Workflow ===



Fetching the Request Token...

obtaining request token from http://api.twitter.com/oauth/request_token

setting oauth_callback to oob

generating signature...

base string is:         POST&http%3A%2F%2Fapi.twitter.com%2Foauth%2Frequest_token&oauth_callback%3Doob%26oauth_consumer_key%3D5hxO6Vy1EGSPmuq76oZrdQ%26oauth_nonce%3D3120336985%26oauth_signature_method%3DHMAC-    SHA1%26oauth_timestamp%3D1389748166%26oauth_version%3D1.0

signature is: gzH3RttYzJxgRk57Bd1GS1tnUDg=

appended additional OAuth parameters: { oauth_callback -> oob , oauth_signature ->   gzH3RttYzJxgRk57Bd1GS1tnUDg= , oauth_version -> 1.0 , oauth_nonce -> 3120336985   , oauth_signature_method -> HMAC-SHA1 , oauth_consumer_key ->  5hxO6Vy1EGSPmuq76oZrdQ , oauth_timestamp -> 1389748166 }

using Http Header signature

sending request...

Exception in thread "main" java.lang.IllegalArgumentException: Cannot get String from     a null object

    at org.scribe.utils.Preconditions.check(Preconditions.java:82)

    at org.scribe.utils.Preconditions.checkNotNull(Preconditions.java:29)

    at org.scribe.utils.StreamUtils.getStreamContents(StreamUtils.java:20)

    at org.scribe.model.Response.parseBodyContents(Response.java:41)

    at org.scribe.model.Response.getBody(Response.java:67)

    at     org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:59)

    at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:39)

    at org.scribe.oauth.OAuth10aServiceImpl.getRequestToken(OAuth10aServiceImpl.java:44)

    at com.example.android.skeletonapp.TwitterExample.main(TwitterExample.java:31)

FYI: twitter have annonced that using SSL/TLS is a requirement to use api.twitter.com as of today.

any help would be appreciated.

该提问来源于开源项目:scribejava/scribejava

somebody else =


推荐阅读
author-avatar
腾讯财经321
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有