public class Authentication
{
public Authentication() { }
public static void main(String[] args) throws Exception
{
System.setProperty("org.apache.commons.logging.Log",
"org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire",
"debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.commons.httpclient",
"debug");
HttpClient client = new HttpClient();
client.getHostConfiguration().setProxy("[our proxy]", 80);
client.getState().setProxyCredentials(null,null,
new NTCredentials("[user name]", "[password]", "[our proxy]", "[domain]")
);
GetMethod get = new GetMethod("http://www.yahoo.com");
get.setDoAuthentication( true );
int status = client.executeMethod( get );
System.out.println(status + "\n" + get.getResponseBodyAsString());
get.releaseConnection();
}
}
Supposedly this should Authenticate through the proxy, and output Yahoo!'s website.
If you can see anything that is needed please respond...
David Rowe
ConAgra Foods, Inc.
Web Application Development - Intern
7350 World Communications Drive
Omaha, NE 68122
Phone: (402) 998-2722
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]