Actually what does the restTemplate.exchange()
method do?
@RequestMapping(value = \"/getphoto\", method = R
The method documentation is pretty straightforward:
Execute the HTTP method to the given URI template, writing the given request entity to the request, and returns the response as ResponseEntity.
URI Template variables are expanded using the given URI variables, if any.
Consider the following code extracted from your own question:
ResponseEntity result =
restTemplate.exchange("http://localhost:7070/spring-rest-provider/krams/person/{id}",
HttpMethod.GET, entity, byte[].class, id);
We have the following:
{id}
). It will be replaced with the value given in the last method parameter (id
).byte[]
wrapped into a ResponseEntity instance.