Skip to content

Instantly share code, notes, and snippets.

@enginebai
Last active July 29, 2018 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enginebai/a6f1cbf397cce9a28b8de2338f35c5e1 to your computer and use it in GitHub Desktop.
Save enginebai/a6f1cbf397cce9a28b8de2338f35c5e1 to your computer and use it in GitHub Desktop.
chainApi1AndApi1()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(object : Subscriber<okhttp3.Response>() {
override fun onCompleted() {
}
override fun onError(e: Throwable) {
e.printStackTrace()
}
override fun onNext(response: okhttp3.Response) {
if (response.isSuccessful)
Logger.d(response)
else
onError(ApiRequestException(response))
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment