How to convert String to JsonObject

后端 未结 2 742
清酒与你
清酒与你 2021-01-01 09:20

I am using a httprequest to get Json from a web into a string.

It is probably quite simple, but I cannot seem to convert this string to a javax.js

2条回答
  •  悲哀的现实
    2021-01-01 10:04

    JsonReader jsonReader = Json.createReader(new StringReader("{}"));
    JsonObject object = jsonReader.readObject();
    jsonReader.close();
    

    See docs and examples.

提交回复
热议问题