标签:cto factor ati ESS height img detail instance 图片
// 设置 restTemplate FormHttpMessageConverter 编码方式
@Configuration
public class RestTemplateConfig {
@Bean
RestTemplate restTemplate(){
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setConnectTimeout(60000);
requestFactory.setReadTimeout(60000);
RestTemplate restTemplate = new RestTemplate(requestFactory);
// 设置 restTemplate FormHttpMessageConverter 编码方式
for (HttpMessageConverter<?> httpMessageConverter : list) {
if(httpMessageConverter instanceof FormHttpMessageConverter) {
((FormHttpMessageConverter) httpMessageConverter).setCharset(Charset.forName(StandardCharsets.UTF_8.toString()));
}
}
restTemplate.setMessageConverters(list);
return restTemplate;
}
}
https://blog.csdn.net/w522301629/article/details/81128630
设置 restTemplate FormHttpMessageConverter 编码方式
标签:cto factor ati ESS height img detail instance 图片
原文地址:https://www.cnblogs.com/badboyh2o/p/10652455.html