How to convert jsonString to JSONObject in Java

前端 未结 19 3004
一生所求
一生所求 2020-11-22 00:39

I have String variable called jsonString:

{\"phonetype\":\"N95\",\"cat\":\"WP\"}

Now I want to convert it into JSON Object. I

19条回答
  •  灰色年华
    2020-11-22 01:41

    Use JsonNode of fasterxml for the Generic Json Parsing. It internally creates a Map of key value for all the inputs.

    Example:

    private void test(@RequestBody JsonNode node)
    

    input String :

    {"a":"b","c":"d"}
    

提交回复
热议问题