spring中用RestTemplate调用接口

import org.springframework.web.client.RestTemplate;
import org.springframework.http.ResponseEntity;
@Autowired
RestTemplate restTemplate;

ResponseEntity<T> responseEntity = restTemplate.getForEntity(url,T.class,orgCode);
--POST请求就用
postForEntity方法

return responseEntity.getBody();
posted @ 2019-11-12 17:30  再见傅里叶  阅读(418)  评论(0编辑  收藏  举报