Retrofit Uploading multiple images to a single key

前端 未结 4 722
孤独总比滥情好
孤独总比滥情好 2020-11-28 05:10

I am using Retrofit to upload images to my server. Here I need to upload multiple images for a single key. I have tried with Postman web client it is working well. Here is a

4条回答
  •  天涯浪人
    2020-11-28 05:42

    The first parameter @method createFormData of class MultipartBody.Part is a string, which is the 'key' or the input name, you can pass the string images[] as an array, and later on you can handle it with your backend language and loop over it to get all the images at position (i)

    check example

提交回复
热议问题