i'm ussing volley to send post requests to my php backend but i'm unable to pass an array as parameters... or add multiple parameters with the same name which only add the last param in the for loop to the params
this code works but only return the last number as parameter and not both numbers:
protected Map<String, String> getParams() {
ArrayList<String> numbers = new ArrayList<String>();
numbers.add("+431111111111");
numbers.add("+432222222222");
Map<String, String> params = new HashMap<String, String>();
for(String object: numbers){
params.put("friendnr[]", object);
}
return params;
}
i just want to pass an array, list of "friendnr" to my php backend..
thx
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…