// Suppose we already know the expected nonce value
digestAuth.overrideParamter("nonce", "whatever");
localcontext.setAttribute("preemptive-auth", digestAuth);
// Add as the first request interceptor
httpclient.addRequestInterceptor(new PreemptiveAuth(), 0);
// Add as the last response interceptor
httpclient.addResponseInterceptor(new PersistentDigest());
HttpHost targetHost = new HttpHost("localhost", 80, "http");