springboot开发使用postman同时上传文件和数据(文件)
环境:springBoot开发
controller路径参数设置如下:
@RequestMapping(value = "/insert") public R insert( @RequestParam("name") String name, @RequestParam("ticketType") String ticketType, @RequestParam("templateType") String templateType, @RequestParam("file") MultipartFile multipartFile,//接受的文件 @RequestParam(value = "remark", required = false) String remark ) {
我并没有使用@RequestBody,不知道是什么原因(按照国际惯例应该是可以的!!!)
postman设置:
就ok了:下图是debug图