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
接口文档的地址为 https://api.mch.weixin.qq.com/v3/merchant-service/images/upload
String filePath = "/your/home/hellokitty.png"; // 应该为 https://api.mch.weixin.qq.com/v3/merchant-service/images/upload URI uri = new URI("https://api.mch.weixin.qq.com/v3/merchant/media/upload"); File file = new File(filePath); try (FileInputStream ins1 = new FileInputStream(file)) { String sha256 = DigestUtils.sha256Hex(ins1); try (InputStream ins2 = new FileInputStream(file)) { HttpPost request = new WechatPayUploadHttpPost.Builder(uri) // 如需直接设置媒体文件元信息,可使用withFile代替withImage .withImage(file.getName(), sha256, ins2) .build(); CloseableHttpResponse response1 = httpClient.execute(request); } }
上面的代码居然也能执行,而且还返回了数据。
另外回复用户的图片格式官网的示例也错了,调试了一整天,都是无效图。 坑爹的腾讯API文档;下面的才是正确的格式
The text was updated successfully, but these errors were encountered:
No branches or pull requests
接口文档的地址为 https://api.mch.weixin.qq.com/v3/merchant-service/images/upload
上面的代码居然也能执行,而且还返回了数据。
另外回复用户的图片格式官网的示例也错了,调试了一整天,都是无效图。
坑爹的腾讯API文档;下面的才是正确的格式
The text was updated successfully, but these errors were encountered: