admin管理员组文章数量:1406033
Flux<DataBuffer> dataBufferFlux = DataBufferUtils.read(path, new DefaultDataBufferFactory(), 4096);
Message message = new Message();
message.setText(body);
message.setSubject(subject);
message.setHtml(true);
message.setFrom(from);
message.setTo(to);
MultipartBodyBuilder builder = new MultipartBodyBuilder();
builder.asyncPart("attachments", dataBufferFlux, DataBuffer.class)
.header("Content-Disposition", "form-data; name=attachments; filename=" + fileName);
builder.part("message", message, MediaType.APPLICATION_JSON);
scaMail.post()
.uri("https://some-url/mail/send")
.contentType(MediaType.MULTIPART_FORM_DATA)
.bodyValue(builder.build())
.retrieve().bodyToMono(String.class)
.timeout(Duration.ofMillis(30000))
.subscribe(response -> System.out.println("Response: " + response));
I'd like sending via WebClient in Spring Boot 3.4 a multipart streamed in chunk request. But it is send in one request and not chunk requests, I have not found how to do this.
本文标签: streamingHow send as chunk POST a multipart with WebClient in SpringStack Overflow
版权声明:本文标题:streaming - How send as chunk POST a multipart with WebClient in Spring - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744966125a2634958.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论