Skip to content

Instantly share code, notes, and snippets.

@j-tim
Created July 13, 2019 09:11
Show Gist options
  • Save j-tim/a176f21d24a8ee7620a1d0b5f42e867e to your computer and use it in GitHub Desktop.
Save j-tim/a176f21d24a8ee7620a1d0b5f42e867e to your computer and use it in GitHub Desktop.
Create a RestTemplate instance as a bean.
package io.stockgeeks.hello.world.api;
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() {
return new RestTemplate();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment