Heim >Datenbank >MySQL-Tutorial >新浪微博API授权

新浪微博API授权

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 15:32:491117Durchsuche

应用未通过审核时,只能加15个测试 用户 。 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) throws WeiboException, IOException, JSONException { // TODO add your handling code here: String code = jTextField1.getText().toSt

应用未通过审核时,只能加15个测试用户

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)

throws WeiboException, IOException, JSONException  {

// TODO add your handling code here:

String code = jTextField1.getText().toString();

try {

access_taken=oauth.getAccessTokenByCode(code).getAccessToken();

Account am = new Account();

am.client.setToken(access_taken);

try {

user_id = am.getUid().getString("uid");

System.out.println(user_id);

//Log.logInfo(uid.toString());

} catch (WeiboException e) {

e.printStackTrace();

}

} catch (WeiboException e) {

if (401 == e.getStatusCode()) {

Log.logInfo("Unable to get the access token.");

} else {

e.printStackTrace();

}

}

}

需要添加异常处理。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:JDBC连接oracle RAC数据库配置Nächster Artikel:oracle表管理