0

I would like to define RestTemplate in a common place and want to re-use them wherever is required via Annotation

  1. How to configure RestTemplate in Spring 4.0 ?
  2. Which place is the right one to declare RestTemplate in WebMVCConfig or generic place?
  3. Do we need to create RestTemplate whenever required, and Http request has to be set everytime?

I come across this page - Basic authentication for REST API using spring restTemplate

Basically my username, password is not going to change. However URL will get change.

I would like to define in a common place. Please help me

Thanks

Tried with RestTemplate restTemplate = new RestTemplate() and it works

0 Answers0