Package facebook4j.internal.http

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


        return revokePermission("me", permissionName);
    }
    public boolean revokePermission(String userId, String permissionName) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(userId, "permissions/" + permissionName));
        return Boolean.valueOf(res.asString().trim());
    }

    public boolean deletePermission(String permissionName) throws FacebookException {
        return revokePermission(permissionName);
    }
View Full Code Here


    }

    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());
    }
   
    public boolean addTagToPhoto(String photoId, TagUpdate tagUpdate) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(photoId, "tags"), tagUpdate.asHttpParameterArray());
View Full Code Here

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

    public boolean addTagToPhoto(String photoId, List<String> toUserIds) throws FacebookException {
        ensureAuthorizationEnabled();
        if (toUserIds.size() == 0) throw new IllegalArgumentException("toUserIds size 0");
View Full Code Here

            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());
    }

    public boolean updateTagOnPhoto(String photoId, TagUpdate tagUpdate) throws FacebookException {
        return addTagToPhoto(photoId, tagUpdate);
    }
View Full Code Here

    }

    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());
    }

    public String postPhoto(Media source) throws FacebookException {
        return postPhoto("me", source);
    }
View Full Code Here

        return getRawString("id", json);
    }

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

    /* Poke Methods */
   
    public ResponseList<Poke> getPokes() throws FacebookException {
View Full Code Here

    }

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

    public ResponseList<Option> getQuestionOptions(String questionId) throws FacebookException {
        return getQuestionOptions(questionId, null);
    }
View Full Code Here

    }
    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());
    }

    public boolean deleteScore() throws FacebookException {
        return deleteScore("me");
    }
View Full Code Here

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

    /* Subscribe Methods */
   
    public ResponseList<Subscribedto> getSubscribedto() throws FacebookException {
View Full Code Here

    }

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

    public boolean makeFriendTestUser(TestUser testUser1, TestUser testUser2) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(testUser1.getId(), "friends/" + testUser2.getId()),
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.