String str = "{\n" +
"\t\"clientID\": 1,\n" +
"\t\"orderType\": 2,\n" +
"\t\"ip\": \"192.168.1.10\",\n" +
"\t\"port\": 3000,\n" +
"\t\"paramType\": \"XML\",\n" +
"\t\"includeXmlStatement\": true,\n" +
"\t\"encodingFormat\": \"默认\",\n" +
"\t\"apiServiceId\": \"f84c0fb10ccf9070561c693a25a16b00\"\n" +
"}";
JSONObject jsonObject = JSONObject.parseObject(str);
//取出data里的数据
String code = jsonObject.getString("clientId");
String orderType = jsonObject.getString("orderType");
String转json
最新推荐文章于 2024-07-05 11:41:32 发布