View RSS Feed

Apache Commons

Apache Commons lang, logging, HttpClient etc.

  1. Preemptive Authentication

    by , 02-24-2012 at 08:03 PM
    Within HttpClient, preemptive authentication can be enabled. HttpClient sends the response of basic authentication before unauthorized is given by server, in preemptive authentication mode. This will be reducing overhead for connection making.
    To enable it, use this code.
    Java Code:
    client.getParams().setAuthenticationPreemptive(true);
    For preemptive authentication, default credentials are required to be set for proxy host or target. Preemptive authentication will ...