How can I define MultipartBody.Part
Part Name in the API Interface.
So I want to define @Part image: MultipartBody.Part
To be like @Part("image") image: MultipartBody.Part
So I want some way that I can omit "image"
from MultipartBody.Part.createFormData("image", image.name, requestBody)
But @Part("image")
do not work with MulitipartBody.Part
@Multipart
@POST("someEndPoint")
suspend fun uploadSometing(
@Header("Authorization") token: String,
@Part image: MultipartBody.Part
): Response
val requestBody = image.asRequestBody()
val imagePart = MultipartBody.Part.createFormData("image", image.name, requestBody)