HttpMediaTypeNotAcceptableException: Could not find acceptable representation
错误原因:请求contenttype=application/json;charset=UTF-8,而这里的produces=text/html
原来代码:
@RequestMapping(value = "/upload", method = RequestMethod.POST, produces = "text/html; charset=UTF-8")
解决方法:去掉 produces = "text/html; charset=UTF-8"这段代码或者设置produces=application/json;charset=UTF-8