<dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.2.24</version> </dependency> Map map=new HashMap(); map.put("page_size","10"); map.put("page_index","1"); String param= JSON.toJSONString(map); Map<String, Object> resultMap = new HashMap<>(); resultMap.put("type", type); resultMap.put("id", 10); resultMap.put("name", "name"); JSONArray jArray = new JSONArray(); jArray.put(resultMap); String str = jArray.toString();