아직도 HttpUtil ? SpringBoot 3.0의 HTTP Client Util 을 사용해보라

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.0.0</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

springboot 3.0 부터는 JDK 17를 기본으로 하고 있다. 꼭 JDK 17로 업그레이드 되었는지 확인 보라!

그리고 http interface 는 webflux (비동기) 로 구현된것이므로 pom.xml 에 webflux도 추가해주자!

application.yml

interface 만든다.

config

Controller 에서 Http 객체를 주입받는다.

참고 : https://docs.spring.io/spring-framework/docs/current/reference/html/integration.html

Last updated