HTTP POST 메서드를 사용하여 지정된 오브젝트를 지정된 URL 또는 URI 템플릿에 게시하여 새 리소스를 생성한다.
T postForObject(URI url, Object request, Class<T> responseType)
url: URI 형식의 URL이다.
request: 게시할 페이로드 객체다. 요청 객체로 HttpEntity를 사용하여 추가 HTTP 헤더를 추가할 수도 있다. null일 수도 있다.
responseType: postForObject 메서드가 반환하는 응답 유형이다.
postForObject 메서드는 지정된 응답 타입의 변환된 객체를 반환한다.
T postForObject(String url, Object request, Class<T> responseType, Map<String,?> uriVariables)
uriVariables: Map 형식의 URI 변수이다.
T postForObject(String url, Object request, Class<T> responseType, Object... uriVariables)
uriVariables: 객체 형식의 URI 변수이다.
kakaoReadyResponse = restTemplate.postForObject(
"https://kapi.kakao.com/v1/payment/ready",
requestEntity,
KakaoReadyResponse.class);
https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/client/RestTemplate.html
https://www.concretepage.com/spring-5/spring-resttemplate-postforobject
https://www.baeldung.com/spring-resttemplate-post-json
좋은 글 잘 읽었습니다, 감사합니다.