FileDocCategorySizeDatePackage
NTLMAuthExample.javaAPI DocExample1809Wed May 18 09:39:00 BST 2005com.discursive.jccook.httpclient

NTLMAuthExample

public class NTLMAuthExample extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

		HttpClient client = new HttpClient();

		// Set credentials on the client
		Credentials credentials =
			new NTCredentials( "testuser", "crazypass", "tobrien.discursive.com", "DOMAIN" );
		client.getState().setCredentials( null, null, credentials );

		String url = "http://webmail.domain.biz/exchange/";
		HttpMethod method = new GetMethod( url );
	
		client.executeMethod( method );
		String response = method.getResponseBodyAsString();

		System.out.println( response );
		method.releaseConnection();