All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.slinkyframework.client.http.RestTemplateBuilder Maven / Gradle / Ivy

There is a newer version: 0.5.1
Show newest version
package org.slinkyframework.client.http;

import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

public class RestTemplateBuilder {

    public static RestTemplateBuilder newRestTemplateBuilder() {
        return new RestTemplateBuilder();
    }

    public RestTemplate build() {

        ClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();

        RestTemplate restTemplate = new RestTemplate(requestFactory);
//        List interceptors = new ArrayList<>();
//        interceptors.add(new LoggingRequestInterceptor());
//
//        restTemplate.setInterceptors(interceptors);
//
//        restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));

        return restTemplate;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy