Kulwinder Singh
09/13/2019, 11:52 AMisSuccess
to see if post
or any other request is success or not. so thats why it return result OK(200) even if i have sent invalid values,
so in above extension function on Response
can i check isSuccess
variable from original json
?
Note: this extension function is called on Response
from retrofitLuca Nicoletti
09/13/2019, 12:19 PMResponse.body
you’re receiving is of the type you’re looking for: YourResponse
and then perform the check 🙂if (response.body() is YourResponse && response.body().isSuccess)
response.body()
will consume it, so better save it in a var