我是javascript中的以下代码
var people = {
"users" : [{id : this.getJID().toString()},{id : this.getJID().toString()}],
"body" : messageBody
}
在我的服务器端,我有以下内容:
JSONObject b = new JSONObject(jsonstring);
JSONArray users = b.getJSONArray("users");
我无法获取用户,因为我将遇到以下异常。
org.json.JSONException: JSONObject["users"] 不是 JSONArray。
我试图转换为 JSONObject 但也出现错误。
JSONObject o = b.getJSONObject("users");
org.json.JSONException: JSONObject["users"] is not a JSONObject.
怎么了??