private void pushMonsterToCreate(SyncedMonsterModel model) throws JSONException, HttpCallException { MyLog.entry("model = " + model); final MyHttpRequest httpRequest = PadHerderDescriptor.RequestHelper.initRequestForPostMonster(context, accountId); /* { "monster": 4, ... } */ final JSONObject json = new JSONObject(); json.put("monster", model.getDisplayedMonsterInfo().getIdJP()); if (model.getCapturedInfo().getCardId() != null) { json.put("pad_id", model.getCapturedInfo().getCardId()); } json.put("current_xp", model.getCapturedInfo().getExp()); json.put("current_skill", model.getCapturedInfo().getSkillLevel()); json.put("current_awakening", model.getCapturedInfo().getAwakenings()); json.put("plus_hp", model.getCapturedInfo().getPlusHp()); json.put("plus_atk", model.getCapturedInfo().getPlusAtk()); json.put("plus_rcv", model.getCapturedInfo().getPlusRcv()); // Latent Awakenings final int[] capturedLatents = model.getCapturedInfo().getLatentAwakenings(); for (int i = 0; i < capturedLatents.length; ++i) { // The api is 1 based json.put("latent" + (i + 1), capturedLatents[i]); } json.put("priority", model.getCapturedInfo().getPriority().getValue()); json.put("note", model.getCapturedInfo().getNote()); httpRequest.setBody(json.toString()); client.call(httpRequest); MyLog.exit(); }