Skip to content
New issue

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

调用【上传临时素材文件】接口返回 44001 多媒体文件为空 #209

Closed
lhshin opened this issue May 4, 2017 · 0 comments
Closed

Comments

@lhshin
Copy link

lhshin commented May 4, 2017

经我验证在代码:
me.chanjar.weixin.common.util.http.MediaUploadRequestExecutor.java中
HttpEntity entity = MultipartEntityBuilder
.create()
.addBinaryBody("media", file)
.setMode(HttpMultipartMode.RFC6532)
.build();
httpPost.setEntity(entity);
httpPost.setHeader("Content-Type", ContentType.MULTIPART_FORM_DATA.toString());

最后设置的contentType导致,去掉此设置即可。
参考:
_Try removing this line

httppost.setHeader("Content-Type", "multipart/form-data");
Updated

as expected the application is sending invalid Content-Type header

[org.apache.http.headers] http-outgoing-5 >> Content-Type: multipart/form-data
Please do not set Content-Type manually and let HttpClient generate it for you based on properties of the HttpEntity enclosed in the request_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants