您的位置:首页 > 产品设计 > UI/UE

文件上传报错:Current request is not a multipart request

2018-01-19 12:23 1201 查看
“error”: “Internal Server Error”,

“exception”: “org.springframework.web.multipart.MultipartException”,

“message”: “Current request is not a multipart request”, “path”: “/upload”



错误原因:Headers填写错误,估计是之前选错了x-www-form-urlencoded

由于上传文件用的Content-Type应该是multipart/form-data,修改之后依然报错。

“error”: “Internal Server Error”,

“exception”: “org.springframework.web.multipart.MultipartException”,

“message”: “Could not parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util.http.fileupload.FileUploadException: the request was rejected because no multipart boundary was found”,

“path”: “/upload”

解析之后发现Content-Type实际用的是text/plain。但是这么输入依然报相同错误。

多次试验之后发现,Content-Type无论选择什么,都会报错。正确的做法是删除Content-Type就行了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐