Content type ‘multipart/form

编程入门 行业动态 更新时间:2024-10-09 00:41:49

Content <a href=https://www.elefans.com/category/jswz/34/1769883.html style=type ‘multipart/form"/>

Content type ‘multipart/form

Content type 'multipart/form-data;boundary=---- ;charset=UTF-8' not support 异常

问题描述

调用微服务接口, 使用 Postman 提交表单格式的数据时, 返回 “Content type ‘multipart/form-data;boundary=---- ;charset=UTF-8’ not support” 错误

解决办法

一是服务接口的请求类型(Content-Type)指定为表单类型: consumes = MediaType.MULTIPART_FORM_DATA_VALUE

二是去掉 @RequestBody 注解

@PostMapping(value = "/form/submit", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
void uploadFile(MultipartFile file, HttpServletResponse response, HttpServletRequest request);

更多推荐

Content type ‘multipart/form

本文发布于:2024-03-10 19:23:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1728837.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:type   Content   form   multipart

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!