I have queried support for the decoding/parsing of "multipart/related" requests on Stack Overflow with no response in nearly 3 weeks. I understand it may not be the best place to ask but perhaps I may get some clarification here (apologies in advance if not appropriate). On reviewing Spring WebFlux documentation for decoding/parsing multipart requests on a server, it seems that just "multipart/form-data" content is supported (see webflux-multipart and webflux-codecs-multipart). There appears to be no mention of "multipart/related" content. It is not clear if/how the decoding/parsing of "multipart/related" requests are supported when using spring-boot-starter-webflux.
-
if supported, are there documented examples (annotated controller, required config etc) to reference?
-
if not, is it planned in later releases?
(using spring-boot.version 2.6.3)
Comment From: sephiroth-j
The documentation suggests, that is possible to access the requests parts of "multipart/mixed" in the same way as for "multipart/form-data" by using @RequestPart
.
But this demo clearly shows that this is not the case! It only works for "multipart/form-data". Using "multipart/mixed" results in a 400 response claiming the required request part is not present. The only difference between these requests is the main content-type.
p.s.
MultipartHttpMessageReader
supports "multipart/mixed" since v5.2 and "multipart/related" since v5.2.5 (2afae430eba0f2e3c0cae50d727b3d79bf0cf02a). However, the overall support seems to be incomplete.
Comment From: sephiroth-j
@rstoyanchev, since you have worked on this topic in the past, would you please look into this issue?
Comment From: rstoyanchev
@sephiroth-j thanks for the investigation and pull request. Indeed we've had support from a WebClient
perspective since 5.2.5 with #24582 with a change in the codecs, but for server side support, we need an update in DefaultServerExchange
as well. I'll close this here as superseded by #29671.