package Ġcom . v nc msk . p unto s de inter es . data Ċ Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġokhttp 3 . logging . Http Logging Interceptor Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . gson . Gson Converter Factory Ċ Ċ object ĠApi Factory Ġ{ ĊĠ Ġprivate Ġconst Ġval Ġurl API Ġ= Ġ" https :// my - json - server . typ icode . com /" ĊĊĠ Ġprivate Ġval Ġok k HttpClient Ġ= ĠOk HttpClient . Builder () ĊĠĠĠ Ġ. add Interceptor ( Http Logging Interceptor (). setLevel ( Http Logging Interceptor . Level . BODY )) ĊĠĠĠ Ġ. build () ĊĊĠ Ġval Ġretrofit : ĠApi Service Ġ= ĠRet rofit . Builder () ĊĠĠĠ Ġ. baseUrl ( url API ) ĊĠĠĠ Ġ. add Converter Factory ( Gson Converter Factory . create ()) ĊĠĠĠ Ġ. client ( ok k HttpClient ) ĊĠĠĠ Ġ. build () ĊĠĠĠ Ġ. run Ġ{ ĊĠĠĠĠĠ Ġcreate ( ApiService :: class . java ) ĊĠĠĠ Ġ} Ċ }