|
|
@ -27,7 +27,15 @@ public class DefaultHttpRequestUtil { |
|
|
.execute() |
|
|
.execute() |
|
|
.body(); |
|
|
.body(); |
|
|
logger.debug("resonponseJson: {}",responseJson); |
|
|
logger.debug("resonponseJson: {}",responseJson); |
|
|
MyHTTPResponse response = JSONUtil.parseObj(responseJson).toBean(MyHTTPResponse.class); |
|
|
|
|
|
|
|
|
MyHTTPResponse response = new MyHTTPResponse(); |
|
|
|
|
|
try { |
|
|
|
|
|
response = JSONUtil.parseObj(responseJson).toBean(MyHTTPResponse.class); |
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
logger.warn("API response is not JSON, raw response: {}", responseJson); |
|
|
|
|
|
response.setCode(200); |
|
|
|
|
|
response.setMsg("success"); |
|
|
|
|
|
} |
|
|
return response; |
|
|
return response; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|