Retrofit 2 Multipart image upload with data

后端 未结 5 719
陌清茗
陌清茗 2020-12-30 16:37

Hello everyone I want to post image and other data through Retrofit2. I am sending data with one image.

All the other info is storing but my image is

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-30 16:45

    there one more simple way to send other data, you can send Hashmap

    @Multipart
        @POST("sign-up")
        Call getSignUpResponse(@Part MultipartBody.Part file, @PartMap() Map partMap); 
    

提交回复
热议问题