Mik*_*e G 16
HttpURLConnection connection = null;
try {
URL url = new URL("www.google.com");
connection = (HttpURLConnection) url.openConnection();
connection.connect();
connection.getInputStream();
// do something with the input stream here
} catch (MalformedURLException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
} finally {
if(null != connection) { connection.disconnect(); }
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19194 次 |
| 最近记录: |