https://
-
[Spring] WebClient 사용시 http:// 프로토콜이 https:/로 자동 변환되는 이슈Spring 2023. 4. 7. 10:54
이슈가 되었던 상황 - 스프링에서 서버간 통신을 사용 할 때 WebClient를 사용 - WebClient를 메서드를 빈에 등록할 때 baseUrl을 집어 넣지 않고 사용하는 WebClient를 사용하는 곳에서 uri에 모든 서버 주소 호출에 재활용 WebClient 메서드를 다음과 같이 빈으로 등록 @Configuration public class WebClientConfig { @Bean public WebClient webClient() { return WebClient.builder() .defaultHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE) .build(); } } 빈에 등록되어 있는 WebClient 메서드 사용 @..