如果response都设置响应头和响应体还是无法下载,那么可能是以下原因:
1.在前端使用window.location.href访问下载方法api,而非ajax。
2.若后台报HttpMediaTypeNotAcceptableException: Could not find acceptable representation异常,将下载方法的返回值改为void。
如果response都设置响应头和响应体还是无法下载,那么可能是以下原因:
1.在前端使用window.location.href访问下载方法api,而非ajax。
2.若后台报HttpMediaTypeNotAcceptableException: Could not find acceptable representation异常,将下载方法的返回值改为void。