public static void doPost(String path){ InputStream in = null; try { URL url=new URL(path); in = url.openConnection().getInputStream(); String content= org.apache.commons.io.IOUtils.toString(in); System.out.println("content is " + content); } catch (IOException e) { System.err.println("error !"); e.printStackTrace(); } }
URL类发起http请求
猜你喜欢
转载自ihenu.iteye.com/blog/2372498
今日推荐
周排行