commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ot...@ivillage.com
Subject RE: HTTPClient - setting default request headers impl Q
Date Thu, 10 Jan 2002 23:00:32 GMT
Hello,

Yes, yes, I'm aware of those two, but I was wondering what I should do when the default header
is set.

I guess I will just add another pair of methods:

setDefaultRequestHeader(String,String)
addDefaultRequestHeader(String,String)

The first one will override any other request header with the same name, and the second one
will add the specified string to the header, and override any previously defined one.
Does that sound right to you?

However, what should happen when someone calls setRequestHeader("header", "FOO") or addRequestHeader("header",
"BAR") after already specifying the value for that header using:
setDefaultRequestHeader("header", "BAR"), for instance?

Should setRequestHeader override the default one?

Thanks,
Otis



On Thu, 10 January 2002, "Waldhoff, 
Rodney" wrote:

> 
> HttpClient has two distinct methods--setRequestHeader and addRequestHeader.
> 
> meth.setRequestHeader("User-Agent", "FOO");
> meth.setRequestHeader("User-Agent", "BAR");
> should yield "User-Agent: BAR"
> 
> meth.addRequestHeader("User-Agent", "FOO");
> meth.addRequestHeader("User-Agent", "BAR");
> should yield "User-Agent: FOO; BAR"
> 
> See
> http://jakarta.apache.org/commons/httpclient/api/org/apache/commons/httpclie
> nt/HttpMethod.html

_________________________________________________________________
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