|
|
@ -53,14 +53,14 @@ public class DataCenterRestTemplateUtils { |
|
|
|
*/ |
|
|
|
public String doPostRequest(String url, Object request) { |
|
|
|
String requestStr = JSONObject.toJSONString(request); |
|
|
|
log.info("请求接口:{}, 请求报文:{}", url, requestStr); |
|
|
|
log.debug("请求接口:{}, 请求报文:{}", url, requestStr); |
|
|
|
HttpHeaders headers = getHttpHeaders(); |
|
|
|
HttpEntity<String> httpEntity = new HttpEntity<>(requestStr, headers); |
|
|
|
String seqResult = ""; |
|
|
|
try { |
|
|
|
ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, httpEntity, String.class); |
|
|
|
seqResult = responseEntity.getBody(); |
|
|
|
log.info("请求接口:{}, 请求报文:{}, 返回报文:{}", url, requestStr, seqResult); |
|
|
|
log.debug("请求接口:{}, 请求报文:{}, 返回报文:{}", url, requestStr, seqResult); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("请求接口:{},返回异常", url, e); |
|
|
|
} |
|
|
|