• Android Cookie(HTTP使用)


    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));

                              作者:xubuhang                出处:http://www.cnblogs.com/xubuhang/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 

     
  • 相关阅读:
    ERROR: epmd error for host "yourhostname": timeout
    leetcode485
    leetcode463
    leetcode496
    leetcode344
    leetcode412
    leetcode500
    leetcode476
    leetcode557
    leetcode461
  • 原文地址:https://www.cnblogs.com/xubuhang/p/4143828.html
  • Copyright © 2020-2023  润新知