Java发送HTTP请求和提取数据的Java代码:
view plaincopy to clipboardprint?import java.io.BufferedReader; import java.io.InputStreamReader; import java.URL; public class Main { public static void main(String[] args) { try { URL my_url = new URL("xasxt/"); BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream())); String strTemp = ""; while(null != (strTemp = br.readLine())){ System.out.println(strTemp); } } catch (Exception ex) { ex.printStackTrace(); } } } import java.io.BufferedReader;import java.io.InputStreamReader;import java.URL;public class Main {public static void main(String[] args) {try {URL my_url = new URL(xasxt/);BufferedReader br = new BufferedReader(new InputStreamReader(my_url.openStream()));String strTemp = "";while(null != (strTemp = br.readLine())){System.out.println(strTemp);}} catch (Exception ex) {ex.printStackTrace();}}}
TAG:
Java代码
提取数据文章由
姿美堂整理,收集辛苦,希望能保留出处,谢谢斑竹大哥。