I am using Volley to send data to the server, Here I am unable to find the way to send both String and Array at a time in a single request.
I can send the array like:
Map<String, List<String>> jsonParams = new HashMap<>();
jsonParams.put("names", my_names_list);
And also I can send String like:
Map<String, String> jsonParams = new HashMap<>();
jsonParams.put("user_id", userId);
but how to send both at a time?
like:
Map<String, String> jsonParams = new HashMap<>();
jsonParams.put("user_id", userId);
jsonParams.put("names", my_names_list); // here it is expecting String but I want to send array of strings to server
the expected JSON request should be like:
{
"user_id": "1",
"names" : ["abc, "cdf", "efg"]
}