url上带小括号()就报400,
转义了还是不行
后台代码
@RequestMapping(value = "/download")
public ResponseEntity<Object> download1(@RequestParam String name, @RequestParam String type) {
logger.info(name, type);
return new ResponseEntity<>(HttpStatus.OK);
}
但是如果改成pathVariable就行了
@RequestMapping(value = "/download/{name}")
public ResponseEntity<Object> download1(@PathVariable String name, @RequestParam String type) {
logger.info(name, type);
return new ResponseEntity<>(HttpStatus.OK);
}
url上带()就报错,带[]和{}都没问题,我在前端区也发了,普遍认为是后台的问题
https://segmentfault.com/q/1010000043992007
貌似后台也是你写的嘛?换个方法,使用post试试?看看后台日志。你想实现get请求下载嘛》?那你使用文件id