List of usage examples for org.apache.http.impl.client DefaultHttpClient setCookieSpecs
public synchronized void setCookieSpecs(final CookieSpecRegistry registry)
From source file:org.jboss.as.test.http.util.HttpClientUtils.java
/** * Creates a http client that sends cookies to every domain, not just the originator * * As we don't actually have a load balancer for the clustering tests, we use this instead. * * @return a http client that gives free cookies to everybody *//*from w w w .ja v a 2 s . co m*/ public static DefaultHttpClient relaxedCookieHttpClient() { DefaultHttpClient client = new DefaultHttpClient(); final CookieSpecRegistry registry = new CookieSpecRegistry(); registry.register("best-match", new CookieSpecFactory() { @Override public CookieSpec newInstance(final HttpParams params) { return new RelaxedBrowserCompatSpec(); } }); client.setCookieSpecs(registry); return client; }