@ SuppressWarnings ( "unchecked" ) public < T > void executeAsync ( Call call , final Type returnType , final ApiCallback < T > callback ) { call . enqueue ( new Callback ( ) { @ Override public void onFailure ( Request request , IOException e ) { callback . onFailure ( new ApiException ( e ) , 0 , null ) ; } @ Override public void onResponse ( Response response ) throws IOException { T result ; try { result = ( T ) handleResponse ( response , returnType ) ; } catch ( ApiException e ) { callback . onFailure ( e , response . code ( ) , response . headers ( ) . toMultimap ( ) ) ; return ; } callback . onSuccess ( result , response . code ( ) , response . headers ( ) . toMultimap ( ) ) ; } } ) ; }
Execute HTTP call asynchronously .