本文介绍了设置cookie的毕加索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试设置Cookie的毕加索连接。我发现这对OkHttp:

im trying to set Cookie for picasso connections . i found this for OkHttp:

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

问题是我不知道在哪里可以设置此为毕加索。所有的想法接受了!谢谢

the problem is i dont know where to set this for Picasso . All ideas accepted ! thanks

推荐答案

您需要使用的扳平两人在一起:

You'll want to use OkHttpDownloader to tie the two together:

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

// Create the downloader for Picasso to use
OkHttpDownloader downloader = new OkHttpDownloader(client);
Picasso picasso = new Picasso.Builder(context).downloader(downloader).build();

这篇关于设置cookie的毕加索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 19:07