大數據

springboot後臺下載文件報錯: Could not find acceptable representation

一開始的代碼,Controller返回的是json內容,代碼是這樣的

@ApiOperation(value = "獲取文件")
@GetMapping(value = "/zip")
Result getWorksZip(HttpServletRequest request, HttpServletResponse response,  @RequestParam("wids") String wids);

後面考慮到是否因為使用的是Result對象導致的錯誤改為String後,可以正常下載.

Leave a Reply

Your email address will not be published. Required fields are marked *