标签:方法 ram str res print tps mvc params 出现
@RestController
public class ApiController{
@PostMapping("in")
public ResponseMessage inbound(@RequestParam Map params) {
System.out.println(params);
}
}
方式一:使用 @RequestBody 注解
@RestController
public class ApiController{
@PostMapping("in")
public ResponseMessage inbound(@RequestBody Map data) {
System.out.println(data);
}
}
方式二:使用 request.getParameterMap() 方法
@RestController
public class ApiController{
@PostMapping("in")
public ResponseMessage inbound(HttpServletRequest request) {
Map<String,String[]> paramMap = request.getParameterMap();
}
}
标签:方法 ram str res print tps mvc params 出现
原文地址:https://www.cnblogs.com/devzyh/p/14641340.html