为了账号安全,请及时绑定邮箱和手机立即绑定

在 android 中存储 Http cookie

在 android 中存储 Http cookie

扬帆大鱼 2019-03-30 19:15:23
我使用授权给网站开发一个Android客户端。示例代码如下:public void run() {     handler.sendMessage(Message.obtain(handler, HttpConnection.DID_START));     httpClient = new DefaultHttpClient();     HttpConnectionParams.setSoTimeout(httpClient.getParams(), 25000);     HttpResponse response = null;     try{                     switch (method){         case POST:             HttpPost httpPost = new HttpPost(url);             httpPost.setHeaders(headers);             if (data != null) httpPost.setEntity(new StringEntity(data));             response = httpClient.execute(httpPost);             break;         }         processEntity(response);     }catch(Exception e){         handler.sendMessage(Message.obtain(handler, HttpConnection.DID_ERROR, e));     }     ConnectionManager.getInstanse().didComplete(this);       }如何保存 cookies?
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 550 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号