今天使用post提交表單時顯示app
"timestamp": "2018-10-25T01:21:54.152+0000",
"status": 415,
"error": "Unsupported Media Type",
"message": "Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported",post
而後看了下,由於是post表單提交的,因此Content-Type是application/x-www-form-urlencodedurl
查看服務端代碼code
@RequestMapping(value ="save" , method = RequestMethod.POST)
@ResponseBody
public boolean productSave(@RequestBody Product product){
return productService.saveProduct(product);
}orm
去掉參數裏的@RequestBody就能夠成功io