Map<String,Object> send = new HashMap<String, Object>(); send.put("towxname",wxname); send.put(msgTypeMap.get(msgtype), sendContent); send.put("msgtype", msgTypeMap.get(msgtype)); JSONObject sendJsonObject = new JSONObject();sendJsonObject.putAll(send);
String jsonData = sendJsonObject.toString();
或者:
String jsonData = JSONObject.fromObject(send).toString();
map to json
最新推荐文章于 2024-07-01 16:28:25 发布