Created
January 22, 2018 10:43
-
-
Save ar-android/972938c3b380f1f1c29a962f3309804d to your computer and use it in GitHub Desktop.
Loop array images request body
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MultipartBody.Builder builder = new MultipartBody.Builder(); | |
MediaType MEDIA_TYPE_PNG = MediaType.parse("image/png"); | |
int i = 0; | |
for (Image imageData : listImage) { | |
builder.addFormDataPart("uploaded_file" + "["+ i +"]", imageData.getName(), RequestBody.create(MEDIA_TYPE_PNG, new File(imageData.getPath()))); | |
i++ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment