简体   繁体   English

从非结构化 JSON 响应中提取一个值

[英]Extract a value from unstructured JSON response

My JSON response contains the token in a strange way as marked with the red line in the picture我的 JSON 响应以一种奇怪的方式包含令牌,如图中红线所示

在此处输入图像描述

How we can extract it without converting it to string and parsing the text?我们如何在不将其转换为字符串并解析文本的情况下提取它? we want to extract it as is in this JSON format我们想按照 JSON 格式提取它

Convert this JSON to a Map<String,Object>.将此 JSON 转换为 Map<String,Object>。 Then you can easily do a getKey() to get the strange(UUId) key, and map.get(key) will give you the value for the key.然后你可以轻松地执行 getKey() 来获取奇怪的 (UUId) 密钥,map.get(key) 将为你提供密钥的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM