问题描述
CloseableHttpClienthttpclient=HttpClients.createDefault();HttpGethttpget=newHttpGet("http://www.gjjx.com.cn/login?hash=0.19097914644896308");ResponseHandler<String>responseHandler=newResponseHandler<String>(){publicStringhandleResponse(finalHttpResponseresponse)throwsClientProtocolException,IOException{intstatus=response.getStatusLine().getStatusCode();if(status>=200&&status<300){HttpEntityentity=response.getEntity();returnentity!=null?EntityUtils.toString(entity):null;}else{thrownewClientProtocolException("Unexpectedresponsestatus:"+status);}}};System.out.println(httpclient.execute(httpget,responseHandler));
解决方案
解决方案二:
http://bbs.csdn.net/topics/390855140
时间: 2024-09-23 04:25:38