Package org.springframework.http.client

Examples of org.springframework.http.client.CommonsClientHttpRequestFactory


    }
  }

  private RestTemplate createRestTemplate() {
    RestTemplate restTemplate = new RestTemplate();
    CommonsClientHttpRequestFactory requestFactory = new CommonsClientHttpRequestFactory();
    requestFactory.setConnectTimeout(TIMEOUT);
    requestFactory.setReadTimeout(TIMEOUT);
    if (httpProxyConfiguration != null) {
      requestFactory.getHttpClient().getHostConfiguration().setProxy(httpProxyConfiguration.getProxyHost(),
          httpProxyConfiguration.getProxyPort());
    }
    restTemplate.setRequestFactory(requestFactory);
    return restTemplate;
  }
View Full Code Here


    private RestTemplate restTemplate;

    @Before
    public void setUp() {
        HttpClient httpClient = new HttpClient();
    this.restTemplate = new RestTemplate(new CommonsClientHttpRequestFactory(httpClient));
    }
View Full Code Here

TOP

Related Classes of org.springframework.http.client.CommonsClientHttpRequestFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.