package de.juplo.demo.httpresources;
-import org.apache.http.client.HttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
+import org.springframework.http.client.ClientHttpRequestFactory;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
@SpringBootApplication
public class HttpResourcesDemoApplication
{
@Bean
- public HttpClient httpClient()
+ public ClientHttpRequestFactory clientHttpRequestFactory()
{
- return HttpClientBuilder.create().build();
+ return new HttpComponentsClientHttpRequestFactory();
}