我想通过android中的POST方法将一些数据发送到服务器。我使用以下代码
DefaultHttpClient hc=new DefaultHttpClient();
ResponseHandler <String> res=new BasicResponseHandler();
HttpPost postMethod=new HttpPost(url);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("name", "value"));
nameValuePairs.add(new BasicNameValuePair("password", "value"));
postMethod.setEntity(new UrlEncodedFormEntity(nameValuePairs));
String response=hc.execute(postMethod,res);
但我在响应xml中收到错误响应。错误消息是客户端计算机中禁用cookie。我如何在Android中启用cookie?