@GetMapping("/user")
public ResponseEntity<?> getRoleKey() {
String transactionUrl = "http://localhost:8080/user?_queryFilter={value}";
UriComponents builder= UriComponentsBuilder.fromUriString(transactionUrl).buildAndExpand("name+eq+%22test%22");
try {
HttpHeaders headers = uan.createHttpHeaders("userId", "password");
HttpEntity<String> requestEntity = new HttpEntity<String>(headers);
ResponseEntity<Result> response = restTemplate.exchange(builder.toUriString(), HttpMethod.GET, requestEntity, Result.class);
return new ResponseEntity<String>(response.getBody().getId(), HttpStatus.OK);
}
catch (Exception eek) {
return new ResponseEntity<String>(eek.toString(), HttpStatus.OK);
}
}
我正在努力解决此问题,请帮助我解决此问题。 我做了多次更改,但仍然收到“ 400错误的请求”。