springboot 报错 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

开始 controller 方法写的是   

    @RequestMapping( value = "/add", method = RequestMethod.POST )

    public String add( @RequestBody Map params ) {  

报错 Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported

改成

    @RequestMapping( value = "/add", method = RequestMethod.POST )

    public String add( @RequestParam Map params ) {

就不报错了。

你可能感兴趣的:(java)