public boolean checkResponse(HttpEntity entity, Consumer c) throws Exception { String r = EntityUtils.toString(entity); APIConnection api = new APIConnection(); JSONObject json = new JSONObject(r); String id = (String) json.get(api.getConnection_key()); return id.equalsIgnoreCase("ok"); }