mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-27 20:14:52 +08:00
🐛 #3196 【公众号】修复materialImageOrVoiceDownload接口无法正常刷新AccessToken的问题
This commit is contained in:
@ -35,7 +35,7 @@ public class MaterialVoiceAndImageDownloadOkhttpRequestExecutor extends Material
|
||||
Request request = new Request.Builder().url(uri).get().post(requestBody).build();
|
||||
Response response = client.newCall(request).execute();
|
||||
String contentTypeHeader = response.header("Content-Type");
|
||||
if ("text/plain".equals(contentTypeHeader)) {
|
||||
if ("text/plain".equals(contentTypeHeader) || "application/json; charset=utf-8".equals(contentTypeHeader)) {
|
||||
String responseContent = response.body().string();
|
||||
throw new WxErrorException(WxError.fromJson(responseContent, WxType.MP));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user