Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 87974 invoked from network); 7 Jan 2002 18:01:19 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Jan 2002 18:01:19 -0000 Received: (qmail 193 invoked by uid 97); 7 Jan 2002 18:01:15 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 138 invoked by uid 97); 7 Jan 2002 18:01:13 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 22 invoked from network); 7 Jan 2002 18:01:11 -0000 Date: 7 Jan 2002 10:01:07 -0800 Message-ID: <20020107180107.26061.cpmta@c006.snv.cp.net> X-Sent: 7 Jan 2002 18:01:07 GMT Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 From: otisg@ivillage.com Cc: commons-dev@jakarta.apache.org, commons-dev@jakarta.apache.org X-Mailer: Web Mail 3.9.3.5 Subject: Re: Can't set User-Agent header X-Sent-From: otisg@ivillage.com X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Paul, I agree with you. My solution was too much of a hack. I hate hacks, so I wasn't very happy with my solution either. Something like setDefaultRequestHeader(String name, String value) would be a good addition IMHO. Who has commit access and can do this? I can send a patch later... Thanks, Otis On Sun, 06 January 2002, "Paul C. Bryan" wrote: > > otisg@ivillage.com wrote: > > > I like recycle(), and it makes sense that some request headers are > > reset (e.g. Host header), but it makes less sense to erase some > > request headers that are likely to remain the same in subsequent URL > > retrievals, such as the User-Agent header. > > > > > So how about this change to recycle() method in HttpMethodBase: > > > > > [Example of retaining user-agent request header on recycle call]. > > I am opposed to keeping certain request headers around on recycle calls. > I believe a call to recycle should result in a known, repeatable and > easy-to-document state, similar if not identical to that of creating a > new method instance. > > Trying to decide on what constitutes "headers that are likely to remain > the same in subsequent URL retrievals" is problematic, because this > differs greatly from one application to the next. For example, if > HttpClient is used in a proxy server, "User-Agent" would be that of the > requesting client, and will differ on every single call. > > I might be supportive of the ability to set default values whenever > methods are created or recycled. For instance, something like a > "setDefaultUserAgent" method. This is easier to use, document and test, > IMHO. > > Yours truly, > > Paul C. Bryan > http://pbryan.net/ > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: _________________________________________________________________ iVillage.com: Solutions for Your Life Check out the most exciting women's community on the Web http://www.ivillage.com -- To unsubscribe, e-mail: For additional commands, e-mail: