We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信公众号,素材上传如果直接传给微信可以成功;如果走Java写的Controller代理服务器会出现: the request was rejected because no multipart boundary was found
the request was rejected because no multipart boundary was found
经过排查是因为: MaterialUploadApacheHttpRequestExecutor.execute()方法中63行: httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());
httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());
因为Tomcat处理上传文件时需要请头Content-Type为multipart/form-data; boundary=--------------------------242815868904497413282610
multipart/form-data; boundary=--------------------------242815868904497413282610
但是MaterialUploadApacheHttpRequestExecutor实际发出的请求Content-Type为multipart/form-data; charset=ISO-8859-1
multipart/form-data; charset=ISO-8859-1
自己写代码测试去掉httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());就可以请求成功
Java异常截图
tomcat内部的代码
The text was updated successfully, but these errors were encountered:
欢迎提交pr
Sorry, something went wrong.
pr已提交:#3282
🐛 #3273 【公众号】修复发送文件上传请求时Content-Type没有boundary的问题
6fc1b7a
Successfully merging a pull request may close this issue.
简要描述
微信公众号,素材上传如果直接传给微信可以成功;如果走Java写的Controller代理服务器会出现:
the request was rejected because no multipart boundary was found
经过排查是因为:
MaterialUploadApacheHttpRequestExecutor.execute()方法中63行:
httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());
因为Tomcat处理上传文件时需要请头Content-Type为
multipart/form-data; boundary=--------------------------242815868904497413282610
但是MaterialUploadApacheHttpRequestExecutor实际发出的请求Content-Type为
multipart/form-data; charset=ISO-8859-1
自己写代码测试去掉
httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());
就可以请求成功模块版本情况
详细描述
Java异常截图
tomcat内部的代码
The text was updated successfully, but these errors were encountered: