用什么替换HttpClient来实现接收服务器响应?

URL url = new URL("http://www.marschen.com/data1.html");
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
InputStream in = new BufferedInputStream(httpURLConnection.getInputStream());
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
String line = reader.readLine();
Log.i("HttpThread", line);

你可能感兴趣的:(Android)