发送post请求:
1、发送的数据放在body里
HttpHeaders headers = new HttpHeaders(); // http请求头
headers.setContentType(MediaType.APPLICATION_JSON_UTF8); // 请求头设置属性
HttpEntity<List<WxMpUserInfo>> requestEntity = new HttpEntity<>(wxMpUserInfoList,headers);//wxMpUserInfoList这个就是提交的数据List集合
String forObject = restTemplate.postForObject(url, requestEntity, String.class);//url 是提交的后台路径
发送get请求
restTemplate.getForEntity(url, List.class);//url 请求路径路径中可以添加参数 List.class标识返回数据类型