Package facebook4j.internal.http

Examples of facebook4j.internal.http.HttpParameter


        return getRawString("id", json);
    }
    public String postGroupStatusMessage(String groupId, String message) throws FacebookException {
        ensureAuthorizationEnabled();
        JSONObject json = post(buildEndpoint(groupId, "feed"), new HttpParameter[]{
                            new HttpParameter("message", message)
                          }).asJSONObject();
        return getRawString("id", json);
    }
View Full Code Here


        return createNote("me", subject, message);
    }
    public String createNote(String id, String subject, String message) throws FacebookException {
        ensureAuthorizationEnabled();
        JSONObject json = post(buildEndpoint(id, "notes"), new HttpParameter[] {
                            new HttpParameter("subject", subject),
                            new HttpParameter("message", message)
                          }).asJSONObject();
        try {
            return json.getString("id");
        } catch (JSONException jsone) {
            throw new FacebookException(jsone.getMessage(), jsone);
View Full Code Here

    public ResponseList<Notification> getNotifications(String userId, Reading reading, boolean includeRead) throws FacebookException {
        ensureAuthorizationEnabled();
        String url = buildEndpoint(userId, "notifications", reading);
        HttpResponse res;
        if (includeRead) {
            res = get(url, new HttpParameter[]{new HttpParameter("include_read", 1)});
        } else {
            res = get(url);
        }
        return factory.createNotificationList(res);
    }
View Full Code Here

        return factory.createNotificationList(res);
    }

    public boolean markNotificationAsRead(String notificationId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(notificationId), new HttpParameter[] {new HttpParameter("unread", 0)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

    public boolean updatePageProfilePhoto(URL picture) throws FacebookException {
        return updatePageProfilePhoto("me", picture);
    }
    public boolean updatePageProfilePhoto(String pageId, URL picture) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(pageId, "picture"), new HttpParameter[]{new HttpParameter("picture", picture.toString())});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

    public boolean installTab(String appId) throws FacebookException {
        return installTab("me", appId);
    }
    public boolean installTab(String pageId, String appId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(pageId, "tabs"), new HttpParameter[]{new HttpParameter("app_id", appId)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return Boolean.valueOf(res.asString().trim());
    }

    public boolean displayPagePost(String postId, boolean isHidden) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = post(buildEndpoint(postId), new HttpParameter[]{new HttpParameter("is_hidden", isHidden)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        return block("me", userIds);
    }
    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();
View Full Code Here

    public boolean unblock(String userId) throws FacebookException {
        return unblock("me", userId);
    }
    public boolean unblock(String pageId, String userId) throws FacebookException {
        ensureAuthorizationEnabled();
        HttpResponse res = delete(buildEndpoint(pageId, "blocked"), new HttpParameter[]{new HttpParameter("uid", userId)});
        return Boolean.valueOf(res.asString().trim());
    }
View Full Code Here

        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

TOP

Related Classes of facebook4j.internal.http.HttpParameter

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.