Context
I have to call an API have body with method GET and I use RestClient
Issue
I create bean RestClient by this way
@Bean
RestClient builderRestClient(RestClient.Builder builder) {
return builder.build();
}
When I call API, the reponse like
org.springframework.web.client.HttpClientErrorException$BadRequest: 400 : "{"timestamp":"2024-06-03T23:48:44.044+00:00","status":400,"error":"Bad Request","path":"/get"}"
at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:103) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.client.StatusHandler.lambda$defaultHandler$3(StatusHandler.java:86) ~[spring-web-6.1.8.jar:6.1.8]
at org.springframework.web.client.StatusHandler.handle(StatusHandler.java:146) ~[spring-web-6.1.8.jar:6.1.8]
How to reproduce
I have a demo in this repo. Please take a look and tell me if I miss something. https://github.com/ngocnhan-tran1996/restclient-demo
Spring version: 3.3.0 Java version: 22
Comment From: philwebb
RestClient is a Spring Framework class so you should raise any concerns to https://github.com/spring-projects/spring-framework/issues/. In this case, I think the reason is as described in this stackoverflow.com answer
Comment From: ngocnhan-tran1996
RestClientis a Spring Framework class so you should raise any concerns to https://github.com/spring-projects/spring-framework/issues/. In this case, I think the reason is as described in this stackoverflow.com answer
Thank for your help. But I think this problem relate the way my create bean and I will raise this issue to Spring Framework