Skip to content

Instantly share code, notes, and snippets.

@j-tim
Created July 13, 2019 09:16
Show Gist options
  • Save j-tim/dd67508a8fabc62da2f8eaa35b49aee1 to your computer and use it in GitHub Desktop.
Save j-tim/dd67508a8fabc62da2f8eaa35b49aee1 to your computer and use it in GitHub Desktop.
RestTemplate instance using the RestTemplateBuilder
package io.stockgeeks.hello.world.api;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;
@Configuration
public class RestTemplateConfiguration {
@Bean
public RestTemplate restTemplate(RestTemplateBuilder restTemplateBuilder) {
return restTemplateBuilder.build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment