如何使用facebook api获取用户照片(标记和上传)
我使用的是以下代码,但输出为{"data":[]}
。
URL img_url = null;
try {
img_url = new URL("http://graph.facebook.com/10152463935954109/photos");
}catch (MalformedURLException e){
e.printStackTrace();
return;
}
try {
InputStream in = img_value.openConnection().getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder result = new StringBuilder();
String line;
while ((line = reader.readLine()) != null) {
result.append(line);
}
System.out.println(result.toString());
}catch (IOException e){
e.printStackTrace();
}