作者:腾讯财经321 | 来源:互联网 | 2023-10-12 01:41
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 =