【发布时间】:2012-12-25 08:20:45
【问题描述】:
好的,所以我知道这个问题已经被问过一百万次了,我已经阅读了大部分的帖子和答案,但这是漫长的一天,我的大脑被煎炸了,我无法让它工作......
我有一个 Android 应用程序,我正在修改它以使用 phpbb3 用户表登录,但我很困惑,因为它需要启用 cookie 才能登录。
这是我的应用程序中的当前 httpclient 代码,适用于我的旧的非 phpbb3 用户表:
// defaultHttpClient
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpPost httpPost = new HttpPost(url);
httpPost.setEntity(new UrlEncodedFormEntity(params));
HttpResponse httpResponse = httpClient.execute(httpPost);
HttpEntity httpEntity = httpResponse.getEntity();
is = httpEntity.getContent();
我需要添加什么才能让它接受 cookie?必须能够从 API 8 开始工作。
【问题讨论】:
标签: android cookies httpclient