Shadman
02/27/2024, 11:53 AMktor
and `ktorfit`:
@POST("user/register")
suspend fun singUp(@Body signUpInputModel: SignUpInputModel): Response<SignUpModel>
I try everything . errorBody
, readAsText
, bodyAsText
. my 401 hast a body in the log.
fun singUp(userName: String, mobile: String, password: String) = viewModelScope.launch {
authRepo.singUp(userName, mobile, password).onSuccess { response ->
if (response.isSuccessful)
_signupState.value = Loadable.Success(response.body()!!)
else {
response.errorBody()
}
}.onFailure {
_signupState.value = Loadable.Error(it)
}
}