spring boot后台接收多个json格式参数

后台接口
@RequestMapping(value = “/updateProcess”, produces = “application/json;charset=utf-8”, method = RequestMethod.POST)
@ResponseBody
public String test(@RequestBody JSONObject jsonObject) {
//获取字符串类型参数
String name= jsonObject.getString(“name”);
//获取数字类型参数
int age = jsonObject.getInteger(“age”);
System.out.println(name + “========” +age);
}

postman测试接口
spring boot后台接收多个json格式参数_第1张图片

你可能感兴趣的:(java)