处理会话Cookie中的Andr​​oid排球 [英] Handling Session Cookie in Android Volley

查看:89
本文介绍了处理会话Cookie中的Andr​​oid排球的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于那些unfamilar用乱射它是一个网络图书馆,它将从HttpURLConnection类或HttpClient的取决于Android版本切换它的HTTP请求的客户端,所以有一点我需要知道的是如何添加的Cookie支持,这些客户端类型。我该如何选择加入会话管理两种类型的客户端?

For those unfamilar with Volley its a networking library and,it will switch its http request client from HttpUrlConnection or HttpClient depending on android version, so one thing I need to know is how to add cookie support to each of these client types. How do I opt in to session management for both types of clients?

我已经看到了这个解决方案: 使用饼干与Android凌空库

I have seen this solution: Using cookies with Android volley library

这是朝着正确方向迈出的良好一步。有没有人发现了一种水平推这个逻辑下到库,而无需使用preferences?或凌空引用到应用程序中。我不介意改写凌空辅助类申请这方面的一些支持,但不知道,如果这两种类型的HTTP客户端的支持饼干,究竟是什么,我需要做的,打开cookie支持?

which is a good step in the right direction. Has anyone found a way to push this logic a level down into the library without using preferences? or references from Volley into the application. I don't mind rewriting the Volley helper class to apply some support for this but not sure if both types of http clients support cookies and what exactly I would need to do to turn on cookie support?

也有办法使用排与CookieManager吧?

also is there a way to use Volley with CookieManager perhaps?

推荐答案

看看我的回答对其他你链接的问题。通过指定的HttpClient的凌空使用,它仅会使用一个用于连接。从而不需要以在两个设置cookie。

Take a look at my answer on the other question you linked. By specifying the HttpClient for Volley to use, it will only ever use that one for connections. Thus obviating the need to set cookies on both.

这篇关于处理会话Cookie中的Andr​​oid排球的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆