import org.json.JSONObject;
@RequestMapping(value = "/uploadMultipleFile", method = RequestMethod.POST,consumes = "application/json")
public @ResponseBody void uploadMultipleFileHandler(@RequestBody JSONObject validationData,HttpServletRequest request, HttpServletResponse response) {
System.out.println(validationData);
}
我无法将此请求表格映射到邮递员。它给了我错误:description The request sent by the client was syntactically incorrect.
但是如果我将JSONObject更改为String,那么它的工作形式为POSTMAN。
答案 0 :(得分:0)
你试过吗?
使用@RequestBody Map<String, Object> validationData
代替@RequestBody JSONObject validationData
希望这会对你有所帮助。
public void getValues(@RequestBody Map<String, Object> validationData, final HttpServletRequest request, final HttpServletResponse response) {
System.out.println(pvmValues.get("key"));
}