Retrofit for android @Multipart remove default headers
You can build multipart body by your self in this way (kotlin code but same idea may be expressed with java):
val mpart = MultipartBody.Builder()
.addFormDataPart("param", paramValue)
.addPart(null, someRequestBody).build() // <-- (*) see explanation below
//thus, service method should looks like this:
@POST("upload/endpoint")
fun upload(@Body parts: MultipartBody)
(*) - this is the addPart(headers: Headers, reqBody: RequestBody)
method, when you pass null
to headers arg this removes all headers except Content-Length: