Skip to content

It is not possible to do a @POST with @Multipart with @RetrofitClient and WebClient #49

@dante-ricalde

Description

@dante-ricalde

Describe the bug
Hi guys, @OlgaMaciaszek
I am trying to use @RetrofitClient with WebClient using the retrofit2 @Multipart annotation and it is not possible to do it (it is not working)

I am trying with the following Retrofit Client:

    @Multipart
    @POST("multipart/mono")
    fun multipartMono(@Part("file") file: Mono<org.springframework.http.codec.multipart.Part>): Mono<ResponseEntity<String>>

We want to know if there is a bug to use @Multipart with @RetrofitClient and WebClient or there is not still support for it?
if there is support for it, please can you share the link with the documentation about it?
if there is no support for it, do you have plans to support @Multipart with @RetrofitClient and WebClient?

I did not find spring documentation about how to create a org.springframework.http.codec.multipart.Part from a File, if there is documentation or examples, can you please share it to me?

Currently it is not documented how to use Multipart + Retrofit + WebClient in the official documentation of spring:
https://spring-projects-experimental.github.io/spring-cloud-square/docs/current/reference/html/index.html
https://github.com/spring-projects-experimental/spring-cloud-square
https://spring.io/blog/2021/04/13/introducing-spring-cloud-square

The examples out there are using Multipart + Retrofit + Okhttp:
https://square.github.io/retrofit/
https://futurestud.io/tutorials/retrofit-2-passing-multiple-parts-along-a-file-with-partmap
https://adinugroho.medium.com/upload-image-from-android-app-using-retrofit-2-ae6f922b184c
https://stackoverflow.com/questions/34562950/post-multipart-form-data-using-retrofit-2-0-including-image

I am looking forward to hearing from you!
Best Regards!

If possible, please provide a test case or sample application that reproduces
the problem. This makes it much easier for us to diagnose the problem and to verify that
we have fixed it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions