List of usage examples for java.net URL openConnection
public URLConnection openConnection() throws java.io.IOException
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getDoOutput()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getFileNameMap()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getContentType()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getAllowUserInteraction()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); System.out.println(uc.getConnectTimeout()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { URL url = new URL("http://hostname:80"); URLConnection conn = url.openConnection(); conn.setRequestProperty("Cookie", "name1=value1; name2=value2"); conn.connect();//from w w w . j av a2 s . c o m }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); uc.setDefaultUseCaches(true);//from ww w .j a v a2 s . co m System.out.println(uc.getDefaultUseCaches()); }
From source file:Main.java
public static void main(String[] argv) throws Exception { URL u = new URL("http://127.0.0.1/test.gif"); URLConnection uc = u.openConnection(); uc.setUseCaches(false);/* www . ja v a2 s . c o m*/ long timestamp = uc.getLastModified(); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); uc.setReadTimeout(1000);//from w w w . ja v a 2 s . co m System.out.println(uc.getReadTimeout()); }
From source file:Main.java
public static void main(String args[]) throws Exception { URL u = new URL("http://www.java2s.com"); URLConnection uc = u.openConnection(); uc.setAllowUserInteraction(true);//from ww w .java2s . co m System.out.println(uc.getAllowUserInteraction()); }