Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] RestClient uriBuilder.path() 이슈 #6

Open
yungwangoh opened this issue May 18, 2024 · 0 comments
Open

[BUG] RestClient uriBuilder.path() 이슈 #6

yungwangoh opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yungwangoh
Copy link
Contributor

이슈 .uri(uriBuilder -> uriBuilder.path())

@Bean
    public RestClient.Builder restBuilderClient() {
        return RestClient.builder();
    }

@Bean
    public RestClient.Builder restBuilderClient() {
        return RestClient.builder().baseUrl("https://address.com");
    }

해당 이슈는 baseUrl을 기입안하고,
RestClient에 uriBuilder -> uriBuilder.path() 에서 문제가 생긴다.
전체 주소로 보낼 경우 http:// ... -> http:/ 으로 날아간다.

해결

 public URI generateUri(Object... obj) {
        return UriComponentsBuilder.fromHttpUrl(this.url).build(obj);
    }

직접 URI 생성하여 .uri(generateUri()) 에 넣는 방식으로 해결하였다.

@yungwangoh yungwangoh added the bug Something isn't working label May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant