+ ",oauth_verifier=\"" + strPIN + "\"";
HTTPRequest request = new HTTPRequest(url,HTTPMethod.GET);
request.addHeader(new HTTPHeader("Authorization",authorization));
URLFetchService service = URLFetchServiceFactory.getURLFetchService();
HTTPResponse response = service.fetch(request);
if(response.getResponseCode() == 200)
{
//继续执行
}
else if(response.getResponseCode() == 401)
{
Common.sendMessage(fromJID, "PIN码无效,请使用-oauth命令重新获取PIN码");
Common.log.info(Common.getStrJID(fromJID) + " bind:" + new String(response.getContent()));
return;
}
else
{
Common.sendMessage(fromJID,"未知错误,请重试");
Common.log.info(Common.getStrJID(fromJID) + " bind:" + new String(response.getContent()));
return;
}
/* 提取接收到的未经授权的Request Token */
String tokenstring = new String(response.getContent());
String[] tokenarr = tokenstring.split("&");
String[] tokenarr2 = tokenarr[0].split("=");
oauth_token = tokenarr2[1];
tokenarr2 = tokenarr[1].split("=");
String oauth_token_secret = tokenarr2[1];