0
我在訪問URL時收到了java.net.unknownhostexception,但我可以通過瀏覽器訪問。訪問graph.facebook.com時出現未知主機異常
public static void main(String[] args) throws IOException, JSONException`enter code here`
{
JSONObject json = readJsonFromUrl("https://graph.facebook.com/page_id/?
access_token=xxxxx&fields=name,likes,posts");
System.out.println(json.toString());
System.out.println(json.get("likes"));
}