springboot 接收请求报错 Required String parameter is not present

@RequestMapping( value = "/detail" )
public SDResponse detail( @RequestParam String name ) { ... }

方法收到请求时,报错 Required String parameter is not present

解决:
改成  
@RequestMapping( value = "/detail" )
public SDResponse detail( @RequestBody Map params ) {
  String name = params.get("name").toString();
  ...
}
就不报错了

你可能感兴趣的:(java)