HttpMediaTypeNotSupportedException

来源:互联网 发布:java中for循环语句例子 编辑:程序博客网 时间:2024/06/08 15:56

用spring boot , ajaxSubmit做文件上传时报下面微信客户端console报的错误:

①"Unsupported Media Type"

②WebKitFormBoundaryqgaLFyCj14dJw6y7;charset=UTF-8' not supported

③org.springframework.web.HttpMediaTypeNotSupportedException


搜了很多文章后面发现是我在除了文件的参数封装上加了@RequestBody,像下面这样写了

HttpServletRequest req, @RequestBody FileBusinessRelation fi, @RequestParam(value = "file", required = false) MultipartFile... file

,技术太渣的我没有找到这个错误,后面解决了才发现的。


还有浏览器这样显示的:

HTTP Status 415 -

type Status report

message

description The server refused this request because the request entity is in a format not supported by the requested resource for the requested method.


贴出来给大家参考一下,


spring boot 的文件上传可以看看这篇文章(点击打开链接)

其实跟spring boot也没有关系,不过这篇文章下面的链接也有spring mvc 上传的还有spring上传的链接。

0 0
原创粉丝点击