For example,

try {
  URL u = new URL("http://www.amnesty.org/");
  HttpURLConnection huc = (HttpURLConnection) u.openConnection();
  huc.setRequestMethod("PUT");
  huc.connect();
  OutputStream os = huc.getOutputStream();
  int code = huc.getResponseCode();
  if (code >= 200 && port < 300) { 
   // put the data...
  }
  huc.disconnect();
}
catch (IOException e) { //...

Previous | Next | Top | Cafe con Leche

Copyright 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified November 8, 2000