Created
June 30, 2019 19:07
-
-
Save ImaginativeShohag/fcde0297e9cd5b2fb774c6893436f431 to your computer and use it in GitHub Desktop.
Retrofit2 Multi Part File Upload ApiInterface class
This file contains 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
import java.util.List; | |
import okhttp3.MultipartBody; | |
import okhttp3.RequestBody; | |
import retrofit2.Call; | |
import retrofit2.http.Multipart; | |
import retrofit2.http.POST; | |
import retrofit2.http.Part; | |
public interface ApiInterface { | |
@Multipart | |
@POST("multifileupload/index.php") | |
Call<SuccessData> uploadFiles( | |
@Part("description") RequestBody description, | |
@Part List<MultipartBody.Part> files | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment