Package HTTPClient

Examples of HTTPClient.URI


  {
      System.err.println("Usage: java GetAuthInfo [-proxy_auth <username> <password>] <url>");
      System.exit(1);
  }

  URI url = new URI(args[0]);

  DefaultAuthHandler.setAuthorizationPrompter(new MyAuthPrompter(pa_name, pa_pass));
  HTTPConnection con = new HTTPConnection(url);
  HTTPResponse   rsp = con.Head(url.getPathAndQuery());

  int sts = rsp.getStatusCode();
  if (sts < 300)
      System.out.println("No authorization required to access " + url);
  else if (sts >= 400  &&  sts != 401  &&  sts != 407)
View Full Code Here

TOP

Related Classes of HTTPClient.URI

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.