ResponseEntity result;
HttpEntityentity =new HttpEntity<>(requestJson, headers);
try {
result =RestConfig.getRestConfig().getRestTemplate().exchange(sendUrl, post, entity, String.class);
}catch (HttpClientErrorException e) {
result =new ResponseEntity<>(e.getResponseBodyAsString(), e.getResponseHeaders(), e.getRawStatusCode());
}
HttpClientErrorException处理
最新推荐文章于 2025-02-13 11:03:40 发布