英文:
Extract fields from complicated server response
问题
{ "bankAccounts": [
{
"id": "wfasfsd",
"balance": { "amount": 90, "currency": "GBP" }
}
]}
英文:
I have a server response that has this format:
{"bankAccounts":[
{"id" :"wfasfsd",
"balance":{"amount":90, "currency":"GBP"}
}
]
I cant find out how to parse through it efficiently
For a similar response with of simpler format this post helped me (https://stackoverflow.com/questions/63702281/extract-jsonobject-and-iterate-through-hashmap-field)
The picture shows exactly how the server response looks like. I need to extract this into JSON and in the end, I need to have a HashMap with keys id, amount, currency
答案1
得分: 1
你可以使用json-simple库来读取和写入JSON对象。
在这里,你可以看到如何使用它。
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论