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

来源:互联网 发布:js刷新frame 编辑:程序博客网 时间:2024/05/20 00:12
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);
0 0
原创粉丝点击