REST multipart mixed request (file+json) with Spring

前端 未结 4 2319
逝去的感伤
逝去的感伤 2021-02-20 12:37

I need to send a file alongside with a json to my Spring Controller. I have the following controller class:

@Controller
@RequestMapping(\"/perform\")
public cla         


        
4条回答
  •  隐瞒了意图╮
    2021-02-20 12:56

    The multipart/mixed for spring webflux(2.1.0) did not work for me. Here is an alternative approach that worked

    • Working - spring-boot-starter-web/Multipart[] - upload files where one is the payload, another is a file itself. In my case since the payload was constant, it worked.
    • Not working - spring-boot-starter-webflux/Flux. The flux is empty. I tried this https://github.com/spring-projects/spring-boot/issues/13268, but it didn't work

提交回复
热议问题