I want to send data like packageid[]=1&packageid[]2
. The same applies for the amount. The key will be the same, but the value will be different.My Packageid[] would be same and values would be different.and my question is different.
HashMap<String,String> params1 = new HashMap<String,String>();
params1.put("customerId", String.valueOf(helpervalue));
params1.put("vechileId", String.valueOf(vehicalId));
params1.put("timeslotId", String.valueOf(timeSlotId));
params1.put("registrationYear", String.valueOf(registeryear));
params1.put("franchiseId", String.valueOf(helpervalue2));
params1.put("jobDate", String.valueOf(date));
params1.put("vehicleRegistrationNumber", String.valueOf(register));
params1.put("totalAmount", String.valueOf(total)+"&"+getURlFromArray1(strint));`
private String getURlFromArray1(int arr[]) {
String makeupSTR = "";
for(int val : arr)
makeupSTR += arr1Key+"="+val+"&";
if(makeupSTR.contains("&"))
makeupSTR = makeupSTR.substring(0, makeupSTR.lastIndexOf("&"));
return makeupSTR;
}
I am expecting to send the following query string structure:
?access=true&action=place_order&type=Add&franchiseId=1&jobDate=2016-01-30&customerId=1&vehicleRegistrationNumber=1&vehicleMakeId=1®istrationYear=2016&totalAmount=250.36&packageIds[]=1&packageIds[]=2&packageAmounts[]=20&packageAmounts[]=30
which responds with JSON like
{
status: false,
displayMessage: "This Slot has just been booked. Please Select a different Time Slot."
}