安卓HttpClient Cookie

10

Android HttpClient是否具有自动管理Cookie的功能?

2个回答

6

0

你可以将它设为静态并在所有请求中使用

client =  new OkHttpClient();  // client will be static and use in all requests 

CookieManager cookieManager = new CookieManager();
cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL);
client.setCookieHandler(cookieManager);

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接