[EMAIL PROTECTED] 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 PROTECTED]> http://pbryan.net/ -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
