Examples of asJSONObject()


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

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

   
    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

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

        Map<String, String> header = new HashMap<>();
        header.put("Accept", "application/json");
        HttpRequest req = new HttpRequest(RequestMethod.GET, "http://where.yahooapis.com/geocode", para, null, header);
        HttpResponse resp = client.request(req);
        requestCounter++;
        return resp.asJSONObject().getJSONObject("ResultSet");
    }

    public boolean isOk(JSONObject obj) throws JSONException {
        return obj.getInt("Error") == 0;
    }
View Full Code Here

Examples of weibo4j.http.Response.asJSONObject()

      {
        log(response.asString());
        try {
          throw new WeiboException(getCause(responseCode),
              response.asJSONObject(), responseCode);
        } catch (JSONException e) {
          e.printStackTrace();
        }
      }
      return response;
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.