there is an API I'm working with it, and in login section API accepts only "data-form" request here is the solutions I found after many searches but it doesn't work
@Multipart
@POST("oauth/token")
suspend fun loginUser (@Part ("username") username:RequestBody,
@Part ("password") password:RequestBody,
@Part("grant_type") grantType:RequestBody):Response<Any>
and here is the instruction I took in MainActivity
val pass="password"
lifecycleScope.launch {
val request= movieService.loginUser(
username = userName.toRequestBody("text/plain".toMediaTypeOrNull()),
password = password.toRequestBody("text/plain".toMediaTypeOrNull()),
grantType = pass.toRequestBody("text/plain".toMediaTypeOrNull())
)
Log.i("login",request.body().toString())
}