OldHttpClientApi { public void get2(){ String requesturl = "http: GetMethod getMethod = new GetMethod(requesturl); try { String APIKEY = "4b441cb500f431adc6cc0cb650b4a5d0"; String INFO ="北京时间"; NameValuePair nvp1=new NameValuePair("key",APIKEY); NameValuePair nvp2=new NameValuePair("info",INFO); NameValuePair[] nvp = new NameValuePair[2]; nvp[0]=nvp1; nvp[1]=nvp2; String params=EncodingUtil.formUrlEncode(nvp, "UTF-8"); getMethod.setQueryString(params); byte[] responseBody = executeMethod(getMethod,10000); String content=new String(responseBody ,"utf-8"); log.info(content); }catch (Exception e){ log.error(""+e.getLocalizedMessage()); }finally { getMethod.releaseConnection(); } }  void post(); void get(); void get2();  }
@Test public void testGet2() throws Exception { old.get2(); }