| | |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | public static String defaultGet(String url) { |
| | | HttpClient client = new HttpClient(); |
| | | GetMethod method = new GetMethod(url); |
| | | try { |
| | | client.executeMethod(method); |
| | | method.getStatusCode(); |
| | | return method.getResponseBodyAsString(); |
| | | } catch (HttpException e) { |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public static String get(String url, Map<String, String> map) { |
| | | HttpClient client = new HttpClient(); |
| | | // client.getHostConfiguration().setProxy("192.168.1.122", 8888); |
| | |
| | | |
| | | public static InputStream getAsInputStream(String url) { |
| | | HttpClient client = new HttpClient(); |
| | | client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); |
| | | GetMethod method = new GetMethod(url); |
| | | try { |
| | | client.executeMethod(method); |