I have the following image download method in my controller (Spring 4.1):
@RequestMapping(value = \"/get/image/{id}/{fileName}\", method=RequestMethod.GET)
p
Pay attention to your HTTP Accept header. For example, if your controller produces "application/octet-stream" (in response), your Accept header should NOT be "application/json" (in request):
@GetMapping(value = "/download", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
public void download(HttpServletResponse response) {}