I need to do Volley POST method with this kind of body for onResponse method:
{"table":{"ma":1,"mb":2},"token":"access"}.
So basically I need HashMap called "params" that takes multiple key-value pairs as values for "table" key, and single value for"token" key, that goes inside Volley request.
I tried to do this,but it requires List for second argument for "token" value
Map<String, List<String>> params = new HashMap<>();
// Hash map for "ma"
HashMap<String, String> maParams = new HashMap<>();
maParams.put("ma", "1");
Hash map for "mb"
HashMap<String, String> mbParams= new HashMap<>();
mbParams.put("mb", "2");
// Table values
List<String> values = new ArrayList<>();
values.add(String.valueOf(maParams));
values.add(String.valueOf(mbParams));
params.put("table", beacons);
params.put("token", "access");
Any ideas how I can do that? Thanks in advance.