Content type ‘multipart/form-data;’ …not supported"
在开发当中遇到了这个问题:
Content type ‘multipart/form-data;boundary=----WebKitFormBoundarypOpfYxCGU6Q4sciA;charset=UTF-8’ not supported
点击请求会看待这样一个,preview:
We’re sorry but mff doesn’t work properly without JavaScript enabled. Please enable it to continue.
背景:在开发文件上传时遇到的,文件类型:doc、docx、Excel、rar等等。
问题解决思路:一个优秀的前端工程师就是可以帮助后端解决问题~
1.查看Content-Type,提醒后端开发人员补全,headers.put();
2.查看后端开发写的代码,让其去掉 @RequestBody,然后你会发现问题解决了;
举个例子:
// 栗子🌰
@PostMapping(path = "/applySource"