I want to get Facebook post's comments using HttpsUrlConnection this is url https://graph.facebook.com/399455050251075/comments?access_token={my_access_token}
String urlAddress = "https://graph.facebook.com/" + postId + "/comments?access_token=" + "{my_access_token}";
try {
URL url = new URL(urlAddress);
HttpsURLConnection httpURLConnection = (HttpsURLConnection) url
.openConnection();
httpURLConnection.setDoInput(true);
httpURLConnection.setDoOutput(true);
httpURLConnection.setReadTimeout(10000);
httpURLConnection.setConnectTimeout(10000);
httpURLConnection.setRequestMethod("GET");
String response = ConnectionController.getResponse(httpURLConnection);
Log.v(Constants.TAG, urlAddress);
Log.v(Constants.TAG, response);
} catch (IOException e) {
e.printStackTrace();
}
it is working on browser very well but in Android I get FileNotFoundException
Note: I don't want to use Facebook SDK or any other library