我的问题是我不知道如何从重定向的URL获取验证码。代码正在身体中回响。
HttpURLConnection igConnection = (HttpURLConnection) instagramURL.openConnection();
igConnection.setDoInput(true);
igConnection.setDoOutput(false);
if (igConnection.getResponseCode() == HttpURLConnection.HTTP_OK){
InputStream is = igConnection.getInputStream();
String response = "";
if (is != null){
BufferedReader in = new BufferedReader(new InputStreamReader(is));
StringBuffer input = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
input.append(line);
}
in.close();
System.out.println(input.toString());
}
}
我得到的是<html>
...
我只想刷新accessToken以防将来过期(检查)。
根据此pattern
,我的授权链接是正确的