HttpGet request = new HttpGet(
"http://xxxx.xxx/xxxxx"); request.setHeader("Cookie", "key=" + “xxxxxxxxxxx”);//服务器自定义Cookie HttpResponse response = httpclient.execute(request); // 模拟请求 int code = response.getStatusLine().getStatusCode();// 返回响应码 InputStream in = response.getEntity().getContent();// 服务器返回的数据 System.out.println(inputStreamToString(in));