我想以下列格式发布JSON
并获得GET响应。
提到JSON:
{
"success": true,
"data": {
"id": "234576"
"name": "string"
}
}
答案 0 :(得分:0)
创建2个json对象,如:
JSONObject parent = new JSONObject();
JSONObject child = new JSONObject();
在子对象中,输入:
parent.put("success", true);
child.put("id", "234567");
child.put("name", "string");
parent.put("data", child);
并使用此父对象简单地调用您的服务。