小编rad*_*aun的帖子

Retrofit是否缓存授权请求

我正在尝试在我的应用程序中实现Retrofit,并且它正常工作,除了请求没有被缓存.

所以我有:

@GET("/mobile/api.php")
public void getPromos(
       @QueryMap Map<String, String> options, 
       Callback<ResultPromotions> callBack);
Run Code Online (Sandbox Code Playgroud)

.....

 requestFacade.addHeader("Authorization", authorizationValue);
 requestFacade.addHeader("Cache-Control", "public, max-age=600");
Run Code Online (Sandbox Code Playgroud)

....

 RestAdapter adapter = new RestAdapter.Builder()
            .setRequestInterceptor(requestInterceptor)
            .setClient(new OkClient(okHttpClient))
            .setEndpoint(ENDPOINT)
            .setConverter(new GsonConverter(gson))
            .setLogLevel(RestAdapter.LogLevel.FULL)
            .build();
Run Code Online (Sandbox Code Playgroud)

所以我的问题是:剂量改造缓存授权请求?或者无法缓存此类请求?

android caching authorization retrofit

4
推荐指数
1
解决办法
2277
查看次数

标签 统计

android ×1

authorization ×1

caching ×1

retrofit ×1