Package HTTPClient

Examples of HTTPClient.HTTPConnection.Head()


  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
Copyright © 2018 www.massapi.com. 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.