* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
public static RestTemplate restTemplate(final RestTemplateBuilder restTemplateBuilder) {
final RestTemplate restTemplate = restTemplateBuilder.build();
setRestTemplateMessageConverters(restTemplate);
public static RestTemplate restTemplate(final RestTemplateBuilder restTemplateBuilder) {
final RestTemplate restTemplate = restTemplateBuilder.build();
setRestTemplateMessageConverters(restTemplate);
Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN));
restTemplate.getMessageConverters().add(mappingJackson2HttpMessageConverter);
}
Arrays.asList(MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN));
restTemplate.getMessageConverters().add(mappingJackson2HttpMessageConverter);
}