Package facebook4j.internal.http

Examples of facebook4j.internal.http.HttpResponse


        return factory.createTagList(get(buildEndpoint(photoId, "tags", reading)));
    }

    public boolean addTagToPhoto(String photoId, String toUserId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(photoId, "tags"), new HttpParameter[]{new HttpParameter("to", toUserId)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here


        return Boolean.valueOf(res.asString().trim());
    }
   
    public boolean addTagToPhoto(String photoId, TagUpdate tagUpdate) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(photoId, "tags"), tagUpdate.asHttpParameterArray());
        return Boolean.valueOf(res.asString().trim());
   }
View Full Code Here

        for (String toUserId : toUserIds) {
            Map<String, String> map = new HashMap<String, String>(1);
            map.put("tag_uid", toUserId);
            tags.add(map);
        }
        HttpResponse res = post(buildEndpoint(photoId, "tags"), new HttpParameter[]{new HttpParameter("tags", new JSONArray(tags).toString())});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return addTagToPhoto(photoId, tagUpdate);
    }

    public boolean deleteTagOnPhoto(String photoId, String toUserId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(photoId, "tags"), new HttpParameter[]{new HttpParameter("to", toUserId)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        JSONObject json = post(buildEndpoint(userId, "photos"), photoUpdate.asHttpParameterArray()).asJSONObject();
        return getRawString("id", json);
    }

    public boolean deletePhoto(String photoId) throws FacebookException {
        HttpResponse res = delete(buildEndpoint(photoId));
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        }
    }

    public boolean deleteQuestion(String questionId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(questionId));
        return Boolean.valueOf(res.asString().trim());
   }
View Full Code Here

    public boolean postScore(int scoreValue) throws FacebookException {
        return postScore("me", scoreValue);
    }
    public boolean postScore(String userId, int scoreValue) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(userId, "scores"),
                            new HttpParameter[] {new HttpParameter("score", scoreValue)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

    public boolean deleteScore() throws FacebookException {
        return deleteScore("me");
    }
    public boolean deleteScore(String userId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(userId, "scores"));
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

                    "&permissions=" + HttpParameter.encode(permissions)));
    }
   
    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

        }
    }

    public boolean deleteTestUser(String testUserId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(conf.getRestBaseURL() + testUserId);
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

TOP

Related Classes of facebook4j.internal.http.HttpResponse

Copyright © 2018 www.massapicom. 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.