RestTemplate template=newRestTemplate();String getUsersUrl=userCenterUrl+"/api/users";HttpHeaders headers=newHttpHeaders();headers.set("Accept",MediaType.APPLICATION_JSON_VALUE);UriComponentsBuilder builder=UriComponentsBuilder.fromUriString(getUsersUrl).queryParam("nameOrEmail",nameOrEmail);HttpEntity<?>entity=newHttpEntity<>(headers);ResponseEntity<List>result=template.exchange(builder.build().encode().toUri(),HttpMethod.POST,entity,List.class);
网友评论