我一直在使用Postman Chrome擴展來測試我的API並希望通過發佈發送一個Hashmap。有沒有辦法在Postman中發送地圖作爲參數?是否可以使用Postman Chrome擴展發送散列表?
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);
我的控制器是如下
@RequestMapping(value = "/getBest", method = RequestMethod.POST)
public @ResponseBody
JsonResponse getBest(@RequestBody HashMap hm) {
JsonResponse json = new JsonResponse();
json.setSuccessData(rdtRequestService.getBest(hm));
return json;
}
你需要創建JSON數組並把它發送到服務器 – Apurva