URL类发起http请求
程序员文章站
2022-07-16 14:09:06
...
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(); } }
上一篇: 终于找到组织了
下一篇: jquery简单体验