Package facebook4j.internal.http

Examples of facebook4j.internal.http.HttpResponse.asJSONObject()


    public Map<String, Boolean> block(String pageId, List<String> userIds) throws FacebookException {
        ensureAuthorizationEnabled();
        String _userIds = z_F4JInternalStringUtil.join(userIds.toArray(new String[userIds.size()]), ",");
        HttpResponse res = post(buildEndpoint(pageId, "blocked"), new HttpParameter[]{new HttpParameter("uid", _userIds)});
        Map<String, Boolean> blocks = new HashMap<String, Boolean>();
        JSONObject jsonObject = res.asJSONObject();
        Iterator<String> uids = jsonObject.keys();
        while (uids.hasNext()) {
            String uid = uids.next();
            boolean result = getBoolean(uid, jsonObject);
            blocks.put(uid, result);
View Full Code Here


   
    public List<TestUser> getTestUsers(String appId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = get(conf.getRestBaseURL() + appId + "/accounts/test-users");
        try {
            JSONArray data = res.asJSONObject().getJSONArray("data");
            List<TestUser> testUsers = new ArrayList<TestUser>();
            for (int i = 0; i < data.length(); i++) {
                testUsers.add(factory.createTestUser(data.getJSONObject(i)));
            }
            return testUsers;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.