415错误

415错误_第1张图片
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Nov 13 14:41:09 CST 2018
There was an unexpected error (type=Unsupported Media Type, status=415).
Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported




购物车



    

购物车

userId
itemId
itemTitle
itemImage
itemPrice
num

如果你对Controller加了@RequestBody ,那么你使用普通的post提交就会报415,那么去掉就好了

    @RequestMapping("/cart/save") //以post请求来访问
    public SysResult save(@RequestBody Cart cart) {
        return cartService.save(cart);
    }

你可能感兴趣的:(415错误)