java - Is it possible to send an hashmap with the Postman Chrome extension? -
i've been using postman chrome extension test out api , send hashmap via post. there way send map parameter in postman?
hashmap inputhm = new hashmap(); inputhm.put("mvmt", "vl"); inputhm.put("no", 1); inputhm.put("fe", "e"); inputhm.put("ct", "20"); inputhm.put("ht", "80"); inputhm.put("type", "gp"); inputhm.put("opr_cd", "maeu"); inputhm.put("location", "bert"); inputhm.put("tmnl", "1"); inputhm.put("incl", ""); inputhm.put("id", 1);
my controller follows
@requestmapping(value = "/getbest", method = requestmethod.post) public @responsebody jsonresponse getbest(@requestbody hashmap hm) { jsonresponse json = new jsonresponse(); json.setsuccessdata(rdtrequestservice.getbest(hm)); return json; }
when send request through postman, select type post, select "raw" o , send json in "body" values want put in hashmap, remember select "application/json" . jackson transform json hashmap you.
an example fragment code be
{ "no": 1, "fe": "e", "ct": "20"
}
jackson rest you, mean, mapping json hashmap
Comments
Post a Comment