资源简介

模拟登录 不提供用户名密码

资源截图

代码片段和文件信息

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;






public class gettest {

/**
 * @param args
 * @throws Exception 
 * @throws HttpException 
 */
public static void main(String[] args) throws Exception{
String url = “https://jx.122.gov.cn/“; 
       
        @SuppressWarnings({ “deprecation“ “resource“ })
HttpClient client = new SSLClient();  
        HttpGet request = new HttpGet(url);  
        
        HttpResponse response = client.execute(request);  
        System.out.println(“Response Code: “ +  
        response.getStatusLine().getStatusCode());  
        String result=response.getFirstHeader(“Set-Cookie“).toString();
          System.out.println(“Cookie+“+result);
        BufferedReader rd = new BufferedReader(  
            new InputStreamReader(response.getEntity().getContent()“utf-8“));  
        String line = ““;  
        while((line = rd.readLine()) != null) {  
        System.out.println(line);  
        }  

}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        493  2016-04-17 16:48  httpgettest\.classpath

     文件        387  2016-04-16 11:02  httpgettest\.project

     文件         90  2016-04-16 15:27  httpgettest\.settings\org.eclipse.core.resources.prefs

     文件        598  2016-04-16 11:02  httpgettest\.settings\org.eclipse.jdt.core.prefs

     文件        635  2016-04-17 16:42  httpgettest\bin\daiChuLiWeiZhang

     文件       2167  2016-04-17 16:48  httpgettest\bin\gettest.class

     文件       5490  2016-04-17 17:02  httpgettest\bin\HttpUtil.class

     文件       3248  2016-04-17 17:18  httpgettest\bin\httputiltest.class

     文件       2830  2016-04-17 16:35  httpgettest\bin\jiaShiZhengJiFenDetail

     文件        971  2016-04-17 16:48  httpgettest\bin\SSLClient$1.class

     文件       1766  2016-04-17 16:48  httpgettest\bin\SSLClient.class

     文件        355  2016-04-17 16:38  httpgettest\bin\userLogin

     文件       9901  2016-04-17 16:28  httpgettest\bin\weiZhangHistoryJson

     文件      60841  2016-04-16 10:40  httpgettest\lib\commons-logging-1.1.1.jar

     文件     592008  2016-04-16 09:37  httpgettest\lib\httpclient-4.3.6.jar

     文件     282793  2016-04-16 09:37  httpgettest\lib\httpcore-4.3.3.jar

     文件       1285  2016-04-16 15:41  httpgettest\src\gettest.java

     文件       4674  2016-04-17 17:02  httpgettest\src\HttpUtil.java

     文件       3357  2016-04-17 17:21  httpgettest\src\httputiltest.java

     文件       1669  2016-04-16 12:47  httpgettest\src\SSLClient.java

     目录          0  2016-04-17 17:20  httpgettest\.settings

     目录          0  2016-04-17 17:20  httpgettest\bin

     目录          0  2016-04-17 17:20  httpgettest\lib

     目录          0  2016-04-17 17:20  httpgettest\src

     目录          0  2016-04-17 17:20  httpgettest

----------- ---------  ---------- -----  ----

               975558                    25


评论

共有 条评论