Object to JSONObject

Suppose an object is as follows:

success={
   
   "id":"12521h415"}

String data = EntityUtils.toString(success);
JSONObject jsonObject=JSONObject.parseObject(data);
String id= jsonObject.getString("id");

//  id为:12521h415

Guess you like

Origin blog.csdn.net/afufufufu/article/details/122220940