Code example for HttpContext

Methods: setAttribute

0
    /** 
     * Sets an optional CookieStore to use when making requests 
     * @param cookieStore The CookieStore implementation to use, usually an instance of {@link PersistentCookieStore} 
     */ 
    public void setCookieStore(CookieStore cookieStore) {
        httpContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
    } 
 
    /** 
     * Overrides the threadpool implementation used when queuing/pooling 
     * requests. By default, Executors.newCachedThreadPool() is used. 
     * @param threadPool an instance of {@link ThreadPoolExecutor} to use for queuing/pooling requests. 
     */ 
    public void setThreadPool(ThreadPoolExecutor threadPool) {
        this.threadPool = threadPool;
    } 
 
    /** 
     * Sets the User-Agent header to be sent with each request. By default, 
     * "Android Asynchronous Http Client/VERSION (http://loopj.com/android-async-http/)" is used. 
     * @param userAgent the string to use in the User-Agent header.