如何将对象的列表作为QueryParameter发送?是否可以将对象作为QueryParameter发送?
User u1=new User();
User u2=new User();
List<User> user=new ArrayList<>();
user.add(u1);
user.add(u2);
// How to send the above List of Objects as QueryParameter ???
HttpEntity<Object> entity=new HttpEntity<>(user,headers);
ResponseEntity<boolean> response= restTemplate.postForEntity(url,entity,User.class);
另外,如何接收对象列表的响应?
boolean getResponse( @RequestParam List<User> user ){ // This way is not possible.
}
StackOverflow:java - Spring Boot: Is it possible to send List of Objects as QueryParameter? - Stack Overflow