commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sale, Doug" <ds...@us.britannica.com>
Subject RE: HTTPClient - setting default request headers impl Q
Date Thu, 10 Jan 2002 21:28:07 GMT


> -----Original Message-----
> From: otisg@ivillage.com [mailto:otisg@ivillage.com]
> Sent: Wednesday, January 09, 2002 10:35 PM
> To: commons-dev@jakarta.apache.org
> Subject: Re: HTTPClient - setting default request headers impl Q
> 
> 
> On Tue, 08 January 2002, "Craig R. McClanahan" wrote:
> 
> > On 8 Jan 2002 otisg@ivillage.com wrote:
> > 
> > > Date: 8 Jan 2002 07:41:12 -0800
> > > From: otisg@ivillage.com
> > >
> > > What should happen if one calls setRequestHeader("foo", 
> "bar"), and
> > > "foo" is already set to some value as the default header, 
> and also, what
> > > should happen if things are the other way around?
> > >
> > > I think that setting a default header should take precedence, no?
> > >
> > 
> > In the servlet API, calling response.setHeader("foo", 
> "bar") replaces any
> > previous "foo" values, while calling 
> response.addHeader("foo", "bar") adds
> > an additional value.  You might want to think about using 
> that convention.
> 
> Yes, I thought about it and I just checked the Servlet API.
> But what if one tries this with HTTP Client:
> meth.setRequestHeader("User-Agent", "FOO");
> and
> meth.setRequestHeader("User-Agent", "BAR");
> 
> What should be the final User-Agent request header?
> There can't/shouldn't be User-Agent headers, right?
> 

I think User-Agent headers should be allowed.  The default should be some
HttpClient identifier.  But users should be able to set their own
(overriding) User-Agent header.  This would be useful for testing URL's that
take different actions based on User-Agent.

-Doug


> Thanks,
> Otis
> 
> _________________________________________________________________
> 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:   
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:commons-dev-help@jakarta.apache.org>
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message