Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ImaginativeShohag/fcde0297e9cd5b2fb774c6893436f431 to your computer and use it in GitHub Desktop.
Save ImaginativeShohag/fcde0297e9cd5b2fb774c6893436f431 to your computer and use it in GitHub Desktop.
Retrofit2 Multi Part File Upload ApiInterface class
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