我获得AccessToken和AccessToken_secret之后我就想调用腾讯给的接口,但是发送失败。String AccessToken = prefs.getString("oauth_token", "");//
String AccessToken_secret = prefs.getString("oauth_token", "");
tAPI = new TAPI(OAuthConstants.OAUTH_VERSION_2_A);
oAuth = new OAuthV2("801146625", "e09c524f36e115f907e65960690102b3", "http://www.xunlei.com");
oAuth.setAccessToken(AccessToken);
try {
//String response = tAPI.add(oAuth, encode("json"), encode("Android"), encode("127.0.0.1"));
String response = tAPI.add(oAuth, "json", "Android", "127.0.0.1");
System.out.println("AccessToken----->"+oAuth.getAccessToken());
System.out.println("response=" + response);
} catch (Exception e) {
e.printStackTrace();
}
tAPI.shutdownConnection();
好像用得不对,请问我获得AccessToken和AccessToken_secret要怎么才可以发送一条微博啊?
String AccessToken_secret = prefs.getString("oauth_token", "");
tAPI = new TAPI(OAuthConstants.OAUTH_VERSION_2_A);
oAuth = new OAuthV2("801146625", "e09c524f36e115f907e65960690102b3", "http://www.xunlei.com");
oAuth.setAccessToken(AccessToken);
try {
//String response = tAPI.add(oAuth, encode("json"), encode("Android"), encode("127.0.0.1"));
String response = tAPI.add(oAuth, "json", "Android", "127.0.0.1");
System.out.println("AccessToken----->"+oAuth.getAccessToken());
System.out.println("response=" + response);
} catch (Exception e) {
e.printStackTrace();
}
tAPI.shutdownConnection();
好像用得不对,请问我获得AccessToken和AccessToken_secret要怎么才可以发送一条微博啊?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货