Решение для kotlin:
Попробуйте следующее:
interface IApiService {
@GET("{url}")
suspend fun getRequest(
@Path(value = "url", encoded = true) path: String,
@QueryMap hashMap: Map<String, String>
): Maybe<Response<ResponseBody>>
@FormUrlEncoded
@POST("{url}")
suspend fun postRequest(
@Path(value = "url", encoded = true) path: String,
@FieldMap hashMap: Map<String, String>
): Maybe<Response<ResponseBody>>
@Multipart
@Headers("Content-Type:multipart/form-data")
@POST("{url}")
suspend fun sendDocuments(
@Path(value = "url", encoded = true) path: String,
@PartMap partMap: Map<String, RequestBody>
): Maybe<Response<ResponseBody>>
@Headers("Content-Type: application/json")
@POST("{url}")
suspend fun postRequestForRaw(
@Path(value = "url", encoded = true) path: String,
@Body requestBody: RequestBody
): Maybe<Response<ResponseBody>>
}