HttpURLConnection connection = url.openConnection();connection.connect();int i = connection.getResponseCode();InputStream is = connection.getInputStream();