Code example for HttpContext

Methods: setAttribute

		// Create local HTTP context 
	    httpContext = new BasicHttpContext();
	    // Create a local instance of cookie store 
	    CookieStore cookieStore = new BasicCookieStore();
	    // Bind custom cookie store to the local context 
	    httpContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
	public HttpContext getHttpContext(){
		return httpContext;
	public CookieStore getCookieStore(){
		return (CookieStore) getHttpContext().getAttribute(ClientContext.COOKIE_STORE);
	public static FriendlyWagerContext getInstance() { 
		if (instance == null) instance = new FriendlyWagerContext ();
		return instance;
Contextual code suggestions in your IDE  Get Codota for Java