commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ot...@ivillage.com
Subject Re: Can't set User-Agent header
Date Mon, 07 Jan 2002 18:01:07 GMT
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 <email@pbryan.net>
> http://pbryan.net/
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>

_________________________________________________________________
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
View raw message