package Ġz lc . season . rx download 4 . request Ċ Ċ import Ġio . reactivex . rx java 3 . schedul ers . Schedulers Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġretrofit 2 . Call Adapter Ċ import Ġretrofit 2 . Converter Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . adapter . rx java 3 . Rx Java 3 Call Adapter Factory Ċ import Ġretrofit 2 . converter . gson . Gson Converter Factory Ċ import Ġjava . util . concurrent . TimeUnit ĊĊ Ċ const Ġval ĠFA KE _ BASE _ URL Ġ= Ġ" http :// www . example . com " Ċ Ċ val Ġok HttpClient : ĠOk HttpClient Ġ= ĠOk HttpClient (). newBuilder () ĊĠĠĠ Ġ. connect Timeout ( 1 5 , ĠTimeUnit . SECONDS ) ĊĠĠĠ Ġ. read Timeout ( 1 2 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠ Ġ. write Timeout ( 1 2 0 , ĠTimeUnit . SECONDS ) ĊĠĠĠ Ġ. build () ĊĊ Ċ inline Ġfun Ġ< re ified ĠT > Ġrequest ( ĊĠĠĠ ĠbaseUrl : ĠString Ġ= ĠFA KE _ BASE _ URL , ĊĠĠĠ Ġclient : ĠOk HttpClient Ġ= Ġok HttpClient , ĊĠĠĠ Ġcall Adapter Factory : ĠCall Adapter . Factory Ġ= ĠRx Java 3 Call Adapter Factory . create With Scheduler ( ĊĠĠĠĠĠĠĠ ĠS chedulers . io () ĊĠĠĠ Ġ), ĊĠĠĠ Ġconverter Factory : ĠConverter . Factory Ġ= ĠGson Converter Factory . create () Ċ ): ĠT Ġ{ ĊĠĠĠ Ġval Ġretrofit Ġ= ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠ Ġ. baseUrl ( baseUrl ) ĊĠĠĠĠĠĠĠ Ġ. client ( client ) ĊĠĠĠĠĠĠĠ Ġ. add Call Adapter Factory ( call Adapter Factory ) ĊĠĠĠĠĠĠĠ Ġ. add Converter Factory ( converter Factory ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġreturn Ġretrofit . create ( T :: class . java ) Ċ }