사용자 도구

사이트 도구


springframework:resttemplate

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
springframework:resttemplate [2020/07/20 16:33]
kwon37xi [SpringBoot]
springframework:resttemplate [2022/01/14 15:43] (현재)
kwon37xi
줄 5: 줄 5:
   * [[https://www.baeldung.com/spring-rest-template-builder|Configure a RestTemplate with RestTemplateBuilder | Baeldung]]   * [[https://www.baeldung.com/spring-rest-template-builder|Configure a RestTemplate with RestTemplateBuilder | Baeldung]]
   * [[https://howtodoinjava.com/spring-boot2/resttemplate/|Spring Boot RestTemplate Tutorials - HowToDoInJava]]   * [[https://howtodoinjava.com/spring-boot2/resttemplate/|Spring Boot RestTemplate Tutorials - HowToDoInJava]]
 +  * see [[springframework:feign|Fegin]]
  
 ===== HttpEntity ===== ===== HttpEntity =====
줄 77: 줄 78:
  
 <code java> <code java>
-    @Bean +@Bean 
-    public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) { +public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) { 
-        return restTemplateBuilder +    return restTemplateBuilder 
-                .requestFactory(() -> new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory())) +            .requestFactory(() -> new BufferingClientHttpRequestFactory(new SimpleClientHttpRequestFactory())) 
-                .setConnectTimeout(Duration.ofMillis(5000)) // connection-timeout +            .setConnectTimeout(Duration.ofMillis(5000)) // connection-timeout 
-                .setReadTimeout(Duration.ofMillis(5000)) // read-timeout +            .setReadTimeout(Duration.ofMillis(5000)) // read-timeout 
-                .additionalMessageConverters(new StringHttpMessageConverter(Charset.forName("UTF-8"))) +            .additionalMessageConverters(new StringHttpMessageConverter(Charset.forName("UTF-8"))) 
-                .build(); +            .build(); 
-    } +}
 </code> </code>
 +
 ===== 참조 ===== ===== 참조 =====
   * [[https://www.baeldung.com/spring-resttemplate-logging|Spring RestTemplate Request/Response Logging | Baeldung]]   * [[https://www.baeldung.com/spring-resttemplate-logging|Spring RestTemplate Request/Response Logging | Baeldung]]
 +  * [[https://enterkey.tistory.com/275|Spring에서 RestTemplate을 사용하여 REST 기반 서비스 요청과 테스트하기 - Hello World]] 
 +  * [[https://luvstudy.tistory.com/78|RestTemplate 응답 log 확인하기]] 
 +  * [[https://reflectoring.io/spring-resttemplate/|Complete Guide to Spring RestTemplate]]
springframework/resttemplate.1595230435.txt.gz · 마지막으로 수정됨: 2020/07/20 16:33 저자 kwon37xi