android 客户端(非浏览器)怎么与服务器session保持同步会话
时间:2014-10-17 11:48:24
收藏:0
阅读:312
============问题描述============
小弟在做一个客户端的购物车功能,要获取到服务器session中保存的购物车列表,上传了sessionid却依旧没法获取到购物车,代码在下面:
String urlString = "http://192.168.1.128:8080/Pinzhuo04/servlet/ShowCartServlet";
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(
urlString).openConnection();
httpURLConnection.setRequestProperty("cookie", sessionid);
httpURLConnection.setConnectTimeout(5000);
httpURLConnection.setRequestMethod("POST");
if (httpURLConnection.getResponseCode() != -1) {
InputStream inputStream = httpURLConnection.getInputStream();
return XMLparse(inputStream);
}
============解决方案1============
http://blog.csdn.net/chindroid/article/details/7556363
原文:http://www.cnblogs.com/qibileiru/p/4030462.html
评论(0)