本文整理匯總了Java中io.plaidapp.data.api.AuthInterceptor類的典型用法代碼示例。如果您正苦於以下問題:Java AuthInterceptor類的具體用法?Java AuthInterceptor怎麽用?Java AuthInterceptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AuthInterceptor類屬於io.plaidapp.data.api包,在下文中一共展示了AuthInterceptor類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createApi
import io.plaidapp.data.api.AuthInterceptor; //導入依賴的package包/類
private void createApi() {
final OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new AuthInterceptor(getAccessToken()))
.build();
api = new Retrofit.Builder()
.baseUrl(DribbbleService.ENDPOINT)
.client(client)
.addConverterFactory(
GsonConverterFactory.create(
new GsonBuilder()
.setDateFormat(DribbbleService.DATE_FORMAT)
.create()))
.build()
.create((DribbbleService.class));
}
示例2: createProductHuntApi
import io.plaidapp.data.api.AuthInterceptor; //導入依賴的package包/類
private void createProductHuntApi() {
final OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new AuthInterceptor(BuildConfig.PROCUCT_HUNT_DEVELOPER_TOKEN))
.build();
productHuntApi = new Retrofit.Builder()
.baseUrl(ProductHuntService.ENDPOINT)
.client(client)
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(ProductHuntService.class);
}
示例3: createApi
import io.plaidapp.data.api.AuthInterceptor; //導入依賴的package包/類
private void createApi() {
final OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new AuthInterceptor(getAccessToken()))
.build();
final Gson gson = new GsonBuilder()
.setDateFormat(DribbbleService.DATE_FORMAT)
.create();
api = new Retrofit.Builder()
.baseUrl(DribbbleService.ENDPOINT)
.client(client)
.addConverterFactory(new DenvelopingConverter(gson))
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create((DribbbleService.class));
}
示例4: createProductHuntApi
import io.plaidapp.data.api.AuthInterceptor; //導入依賴的package包/類
private void createProductHuntApi() {
final OkHttpClient client = new OkHttpClient.Builder()
.addInterceptor(new AuthInterceptor(BuildConfig.PROCUCT_HUNT_DEVELOPER_TOKEN))
.build();
final Gson gson = new Gson();
productHuntApi = new Retrofit.Builder()
.baseUrl(ProductHuntService.ENDPOINT)
.client(client)
.addConverterFactory(new DenvelopingConverter(gson))
.addConverterFactory(GsonConverterFactory.create(gson))
.build()
.create(ProductHuntService.class);
}