public RestTemplate getRestTemplate ( ) { if ( restTemplate == null ) { restTemplate = new RestTemplate ( ) ; restTemplate . setRequestFactory ( getRequestFactory ( ) ) ; } restTemplate . setErrorHandler ( getErrorHandler ( ) ) ; if ( ! defaultAcceptHeader ) { for ( org . springframework . http . converter . HttpMessageConverter messageConverter : restTemplate . getMessageConverters ( ) ) { if ( messageConverter instanceof StringHttpMessageConverter ) { ( ( StringHttpMessageConverter ) messageConverter ) . setWriteAcceptCharset ( defaultAcceptHeader ) ; } } } return restTemplate ; }
Gets the restTemplate .