try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(sendUrl);
File uploadFile = new File("/Users/ethan/Downloads/test.jpg");
FileBody uploadFilePart = new FileBody(uploadFile);
MultipartEntity reqEntity = new MultipartEntity();
reqEntity.addPart("media", uploadFilePart);
httpPost.setEntity(reqEntity);
HttpResponse response = httpclient.execute(httpPost);
HttpEntity entity = response.getEntity();
if(entity!=null){
String result = EntityUtils.toString(entity,"UTF-8");
System.out.println(result);
}
}catch (Exception e){
e.printStackTrace();
}
一直返回
{"errcode":47001,"errmsg":"data format error hint: [SAESjA04011548]"}
兄弟,解决了47001问题了吗?
可参考
https://developers.weixin.qq.com/community/develop/article/doc/0000e663a0cc68e29c98822de51c13