Skip to content

restTemplate.exchange doesn't work #12

@hazartilirot

Description

@hazartilirot

Sergey,

I believe I need a hand with the lesson. I'm watching "Make Users Microservice call Albums Microservice" at the moment. The snippet of code is exactly what bothers me at the moment:

 /*
        String albumsUrl = String.format(environment.getProperty("albums.url"), userId);
        
        ResponseEntity<List<AlbumResponseModel>> albumsListResponse = restTemplate.exchange(albumsUrl, HttpMethod.GET, null, new ParameterizedTypeReference<List<AlbumResponseModel>>() {
        });
        List<AlbumResponseModel> albumsList = albumsListResponse.getBody(); 
        */

In the video it works perfectly fine however I went to the most recent version of your repository

to my surprise the code has been commented out. Wouldn't you mind explaining me what arguments I should provide to the restTemplate.exchange ?

Thank you in advanced.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions