post提交的时候有个key的value是个数组,这个怎么写啊,
下边举了个例子,其它都是map put进去的,argv这个怎么搞呢?
{
"user":"abc",
"password":"abcdefg",
"argv":[
"1",
"2",
"3"
]
}
用 List<string> ?
public static String CreateJson()
{
JSONObject my_json=new JSONObject();
my_json.put("class", "二年级");
my_json.put("total", 2);
JSONArray members=new JSONArray();
//第一个同学
JSONObject member1=new JSONObject();
member1.put("name", "李小红");
member1.put("age", 18);
member1.put("score", 95);
members.put(member1);
//第二个同学
JSONObject member2=new JSONObject();
member2.put("name", "王尼玛");
member2.put("age", 28);
member2.put("score", 85);
members.put(member2);
my_json.put("members", members);
return my_json.toString();
}
public static String CreateJson()
{
JSONObject my_json=new JSONObject();
my_json.put("class", "二年级");
my_json.put("total", 2);
JSONArray members=new JSONArray();
//第一个同学
JSONObject member1=new JSONObject();
member1.put("name", "李小红");
member1.put("age", 18);
member1.put("score", 95);
members.put(member1);
//第二个同学
JSONObject member2=new JSONObject();
member2.put("name", "王尼玛");
member2.put("age", 28);
member2.put("score", 85);
members.put(member2);
my_json.put("members", members);
return my_json.toString();
}