dorofeev22 / caregiving

CRM of caregiving
The Unlicense
0 stars 1 forks source link

Add RESTclient example #27

Open dorofeev22 opened 6 years ago

dorofeev22 commented 6 years ago

With RestTemplate and tests

dorofeev22 commented 6 years ago

Logger it for example

    @Autowired
    private RestTemplate restTemplate;

    @PostConstruct
    public void createInterceptors() {
        List<ClientHttpRequestInterceptor> interceptors = new ArrayList<>();
        interceptors.add(new LoggingRequestInterceptor());
        restTemplate.setInterceptors(interceptors);
    }

https://stackoverflow.com/questions/7952154/spring-resttemplate-how-to-enable-full-debugging-logging-of-requests-responses