RestTemplate的postForEntity方法传递数组,将集合转换成json字符串
public Object xxxx(List<Xxxx> xxxx) {
HttpHeaders headers = new HttpHeaders();
HttpEntity<String> entity = new HttpEntity<>(JSON.toJSONString(xxxx), headers);
ResponseEntity<Object> response = restTemplate.postForEntity("url", entity, Object.class);
return response.getBody();
}