<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    少年阿賓

    那些青春的歲月

      BlogJava :: 首頁(yè) :: 聯(lián)系 :: 聚合  :: 管理
      500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks

    package com.abin.lee.hack;

    import java.io.BufferedInputStream;

    import org.apache.http.HttpHost;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.entity.StringEntity;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.junit.Test;

    public class HttpClientVisitTest {

     private static final String HttpUrl = " private static final String HttpHost = "111.111.111.111";
     @Test
     public void testHttpClientVisit() {
      HttpClient httpClient = new DefaultHttpClient();
      HttpPost httpPost = new HttpPost(HttpUrl);
      httpPost.addHeader("Accept", "*/*");
      httpPost.addHeader("Accept-Language", "zh-cn");
      httpPost.addHeader("Referer", HttpUrl);
      httpPost.addHeader("Content-Type", "application/x-www-form-urlencoded");
      httpPost.addHeader("Cache-Control", "no-cache");
      httpPost.addHeader("Accept-Encoding", "gzip, deflate");
      httpPost.addHeader("User-Agent",
        "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)");
      httpPost.addHeader("Host", HttpHost);
      httpPost.addHeader("Connection", "Keep-Alive");
    //  HttpHost httpProxy = new HttpHost("222.222.222.222", 1443, "http");
    //  httpClient.getParams().setParameter(AllClientPNames.DEFAULT_PROXY,httpProxy);
      StringBuffer params = new StringBuffer();
      String userName = "abin";
      String passWord= "varyall";
      String userAge= "12345";
      String homeTown= "china beijing";
      params.append("__userName ").append("=").append(userName )
        .append("&").append(passWord").append("=")
        .append(passWord).append("&").append("userAge")
        .append("=").append(userAge).append("&")
        .append("homeTown").append("=")
        .append(homeTown);
      HttpResponse httpResponse = null;
      String result = "";
      try {
       StringEntity reqEntity = new StringEntity(params.toString());
       httpPost.setEntity(reqEntity);
       HttpHost httpTarget = new HttpHost(HttpHost, 80, "http");
       httpResponse = httpClient.execute(httpTarget, httpPost);
       System.out.println("httpResponse=" + httpResponse.getStatusLine());

       BufferedInputStream buffer = new BufferedInputStream(httpResponse
         .getEntity().getContent());
       byte[] bytes = new byte[1024];
       int line = 0;
       StringBuilder builder = new StringBuilder();
       while ((line = buffer.read(bytes)) != -1) {
        builder.append(new String(bytes, 0, line));
       }
       result = new String(builder.toString());
      } catch (Exception e) {
       e.printStackTrace();
      } finally {
       if (httpPost.isAborted()) {
        httpPost.abort();
       }
       httpClient.getConnectionManager().shutdown();
      }
    //   System.out.println("result="+result);

     }

    }

    主站蜘蛛池模板: 91在线亚洲综合在线| 老司机免费午夜精品视频| 嫩草成人永久免费观看| 国产偷国产偷亚洲清高动态图| 国产亚洲真人做受在线观看| 亚洲jjzzjjzz在线播放| h视频在线观看免费网站| 亚洲日本在线免费观看| 一级特级aaaa毛片免费观看 | 久久国产精品萌白酱免费| 国产亚洲精品福利在线无卡一 | 99久久99久久精品免费看蜜桃 | 精品少妇人妻AV免费久久洗澡| 精品国产成人亚洲午夜福利| 国产一精品一AV一免费孕妇 | 免费观看成人毛片a片2008| 国产成人亚洲合集青青草原精品 | 一级女性全黄久久生活片免费| 免费一级毛片不卡在线播放| 全黄A免费一级毛片| 在线观看亚洲天天一三视| 丁香花在线视频观看免费| 免费中文字幕不卡视频| 亚洲免费一区二区| 久久亚洲精品成人777大小说| 久久久久国产精品免费网站| 2020久久精品亚洲热综合一本| 四虎免费在线观看| 亚洲人成电影青青在线播放| 久久精品国产这里是免费| 亚洲欧洲精品久久| 国产精品视频免费一区二区三区| 91国内免费在线视频| 免费永久在线观看黄网站| 国产精品九九久久免费视频| 午夜亚洲AV日韩AV无码大全| 成年女人喷潮毛片免费播放| 亚洲最大的成人网| 亚洲免费网站在线观看| 婷婷亚洲综合一区二区| 国产精品成人免费综合|