请求用户信息成功时Facebook可以返回不同于200的https状态代码吗?

时间:2016-10-18 08:47:55

标签: java facebook https http-status-codes

我创建了一个代码,用于检查用户是否已登录Facebook。这就是它的样子:

=

接下来,我解析Json,检查它是否为URL url = new URL("https://graph.facebook.com/me?access_token=" + this.fb_token); System.out.println("Attempting to open connection"); HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); int responseCode = conn.getResponseCode(); System.out.println(responseCode); BufferedReader reader; if(responseCode != 200) { reader = new BufferedReader(new InputStreamReader(conn.getErrorStream(), "UTF-8")); } else{ reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); } String json = reader.readLine(); reader.close(); conn.disconnect(); return json; error代码并记录用户。

我的问题是: data是否足够检查? Facebook是否可以在验证成功的情况下返回不同的状态代码?

0 个答案:

没有答案