Return-Path: Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@www.apache.org Received: (qmail 77360 invoked from network); 12 May 2004 07:33:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 12 May 2004 07:33:03 -0000 Received: (qmail 15566 invoked by uid 500); 12 May 2004 07:33:01 -0000 Delivered-To: apmail-jakarta-commons-httpclient-dev-archive@jakarta.apache.org Received: (qmail 15535 invoked by uid 500); 12 May 2004 07:33:01 -0000 Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Commons HttpClient Project" Reply-To: "Commons HttpClient Project" Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 15516 invoked by uid 98); 12 May 2004 07:33:00 -0000 Received: from dcabbar@yahoo.com by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(216.136.175.69):. Processed in 0.024908 secs); 12 May 2004 07:33:00 -0000 X-Qmail-Scanner-Mail-From: dcabbar@yahoo.com via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(216.136.175.69):. Processed in 0.024908 secs) Received: from unknown (HELO web13906.mail.yahoo.com) (216.136.175.69) by hermes.apache.org with SMTP; 12 May 2004 07:33:00 -0000 Message-ID: <20040512073249.23195.qmail@web13906.mail.yahoo.com> Received: from [68.123.124.81] by web13906.mail.yahoo.com via HTTP; Wed, 12 May 2004 00:32:49 PDT Date: Wed, 12 May 2004 00:32:49 -0700 (PDT) From: Cabbar Duzayak Subject: HttpClient initialization, when/where? To: commons-httpclient-dev@jakarta.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hi, I will be writing a gateway which will invoke URLs in behalf of several threads and they will return the content. Each thread needs to invoke different URLs with different context (cookies, etc). It looks like right way of doing this is to instantiate the HttpClient once with MultiThreadedHttpConnectionManager and each thread will use httpClient.executeMethod on this HttpClient instance. Or the other alternative is to instantiate one object for each thread, and keep calling executeMethods on them. However, since you can set the state of the HttpClient, I was wondering if I can use the HttpClient for iterative http invocations with different contexts? I mean, is there an in-memory state other than the HttpState that is preserved between these invocations? Would it be enough to create an HttpState and GetMethod for each call, and set it before calling executeMethod? Shortly, what is the optimum mechanism for this functionality? TIA... __________________________________ Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' http://movies.yahoo.com/showtimes/movie?mid=1808405861 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org