我有,我想发送到服务器POST如何在Android的JSON中包含层次结构?
{
"header1" : {
"message" : {
"content" : "Hello",
"type" : "text"
},
"header2" : {
"address" : "[email protected]"
}
}
}
这是我对JSON pbject 的JSONObject的JSONObject =新的JSONObject()代码这个JSON文件;
jsonObject.put("content", "hello");
jsonObject.put("type", "text");
jsonObject.put("address", "[email protected]");
String message = jsonObject.toString();
我的问题是如何编码层次结构:header1,message和header2?