'Empty multipart file while sending via Spring Boot Web Client

I am trying to send request with MultipartFile named "input" to my client web server but Spring Boot sends request without any body, my function in presented here:

public TranslationDTO correctText(MultipartFile file) throws IOException {
    MultipartBodyBuilder builder = new MultipartBodyBuilder();
    builder.part("input", file.getResource());
    return marianApiWebServer
            .post()
            .uri("/correct")
            .body(BodyInserters.fromMultipartData(builder.build()))
            .retrieve()
            .bodyToMono(TranslationDTO.class)
            .block(REQUEST_TIMEOUT);
}

Do you have any ideas, why my client web server doesn't detect body?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source