How to convert jsonString to JSONObject in Java

前端 未结 19 3002
一生所求
一生所求 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"}
    
    0 讨论(0)
提交回复
热议问题