pom.xml 引入 jar包
org.json
json
20180813
package com.ruoyi.business;
import java.io.IOException;
import org.dom4j.DocumentException;
import org.json.JSONObject;
import org.json.XML;
import org.xml.sax.SAXException;
import javax.xml.parsers.ParserConfigurationException;
public class HttpsPostUtilxaidan {
public static void main(String[] args) throws DocumentException, ParserConfigurationException, IOException, SAXException {
String aa =" " +
" " +
"" +
"true " +
"1221212121212 " +
"" +
" " +
"";
//将xml转换 json
JSONObject jsonObject = XML.toJSONObject(aa);
System.out.println("jsonObject:"+jsonObject);
System.out.println("jsonObjects:"+ jsonObject.getJSONObject("responses").getJSONObject("responseItems").getJSONObject("response").get("success"));
}
}
暑期编程PK赛
得CSDN机械键盘等精美礼品!