一个request包含 header和request body,我们用 HttpEntity<body,header>来构造一个请求
发出request之后会得到 response 用ResponseEntity来接收返回内容
在发送请求的时候,可以使用 HttpClient RestTemplate OkHttp 一个文章看下三者的区别和使用方法。 这里用的okhttpRestTemplate 是自己写的一个util 基本用法和 restTemplate一样。
https://blog.csdn.net/qq_33326449/article/details/107442642
public void orderCenterAlter(OrderAlterVo vo) throws Exception {
// vo为要被传出去的request内容 是一个json类型 可以转为string用logger记录一下
logger.info("OI0023 request::" + JSON.toJSONString(vo));
// 构造headers
HttpHeaders headers = new HttpHeaders();
headers.add("Content-Type", xxxxrHead);
// xxxHeader: application/json;c