Hi, Mike.

Thanks so much. That solved it! I originally had the ..setAuthenticationPreemptive(true)..bit but had taken it out because it didn't seem to work earlier. The explanations were really helpful too.

This is an incredibly helpful list!

Madeleine

Michael Becke wrote:

Hi Madeleine,

The first request fails because the credentials are not sent on the first method execution. This is for two reasons. One, because the proxy credentials have been specified with a particular realm. HttpClient does not know that a URL is protected by a particular realm until is tries and fails. Also, HttpClient by default does not include credentials in requests except when challenged or when preemptive authentication has been turned on. You should be able to fix this problem by doing the following:

// use a null realm
client.getState().setProxyCredentials(null, "cache.ru.ac.za", creds);
// enable preemptive authentication
client.getState().setAuthenticationPreemptive(true);

Mike



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to