new URL(String spec) throws MalformedURLException


import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

public class Main {
  public static void main(String[] argv) throws Exception {
    
    URLConnection conn = new URL("http://www.yourserver.com").openConnection();
    conn.setDoInput(true);
    conn.setRequestProperty("Authorization", "asdfasdf");
    conn.connect();

    InputStream in = conn.getInputStream();
  }
}
Home 
  Java Book 
    Networking  

URL:
  1. URL
  2. new URL(String spec) throws MalformedURLException
  3. URL: getAuthority()
  4. URL: openConnection()
  5. URL: openStream()