https://blog.csdn.net/scm_2008/article/details/127682333
1 返回直是自定一类型
ResponseEntity<RestDto> result = restTemplate.exchange(url, HttpMethod.GET, entity, RestDto.class); //RestDto.class 前面返回值也要ResponseEntity<RestDto>
/**
* @param url
*<T> ResponseEntity<T> exchange(
* String url
* , HttpMethod method
* , @Nullable HttpEntity<?> requestEntity
* , Class<T> responseType
* , Object... uriVariables) throws RestClientException;
*
* url 调用的url地址
* method 枚举值,HTTP方法:GET、POST、PUT、DELETE等
* requestEntity 发起请求时携带的对象:请求头header 和/或 请求体body
* responseType 请求响应对象的类型
* uriVariables 就是针对url中的@PathVariable参数,可变长度参数列表
*
*/