CronetRequestCompletionListener

interface CronetRequestCompletionListener<T>


A completion listener for accepting the results of a Cronet request asynchronously.

To attach to a Cronet request use InMemoryTransformCronetCallback and call addCompletionListener.

Parameters
<T>

the response body type

Summary

Public functions

Unit

Invoked if request was canceled via UrlRequest#cancel.

Unit
onFailed(info: UrlResponseInfo?, exception: CronetException!)

Invoked if request failed for any reason after starting the request.

Unit
onSucceeded(info: UrlResponseInfo!, body: T!)

Invoked when request is completed successfully.

Public functions

onCanceled

fun onCanceled(info: UrlResponseInfo?): Unit

Invoked if request was canceled via UrlRequest#cancel. Once invoked, no other methods will be invoked on this object.

Parameters
info: UrlResponseInfo?

Response information. May be null if no response was received.

onFailed

fun onFailed(info: UrlResponseInfo?, exception: CronetException!): Unit

Invoked if request failed for any reason after starting the request. Once invoked, no other methods will be invoked on this object. exception provides information about the failure.

Parameters
info: UrlResponseInfo?

Response information. May be null if no response was received.

exception: CronetException!

detailed information about the error that occurred.

onSucceeded

fun onSucceeded(info: UrlResponseInfo!, body: T!): Unit

Invoked when request is completed successfully. Once invoked, no other methods will be invoked on this object.

Parameters
info: UrlResponseInfo!

Response information.

body: T!

The response body transformed to the desired type.