A micro-service is providing an api(get request) to download a file which is having a return type as void. It is populating HttpServletResponse but not returning it. How can I get the data from such api?
@GetMapping(value="/download/{id}")
public void download(@PathVariable(value = "id") String id, HttpServletResponse response) {
FileDTO file = downloadFile(id, response);
response.setContentType("text/html");
....
....
}
How can we get the html/text data from the above sample snippet? (Assume all required parameters are set.)