1
0
mirror of synced 2025-12-19 23:08:13 +08:00

okhttp使用方式有错误,body().toString()修改为body().string()

This commit is contained in:
ecoolper
2017-05-04 11:02:24 +08:00
parent 6b7c86da95
commit 59fc9134c8
12 changed files with 17 additions and 12 deletions

View File

@@ -68,7 +68,12 @@ public class WxCpServiceImpl extends AbstractWxCpServiceImpl<ConnectionPool, Okh
} catch (IOException e) {
e.printStackTrace();
}
String resultContent = response.body().toString();
String resultContent = null;
try {
resultContent = response.body().string();
} catch (IOException e) {
e.printStackTrace();
}
WxError error = WxError.fromJson(resultContent);
if (error.getErrorCode() != 0) {
throw new WxErrorException(error);