You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Ollie Rutherfurd <ol...@rutherfurd.net> on 2003/10/21 19:48:14 UTC

addRequestHeader doesn't work for "Cookie"?

Hi,

I'm using HttpClient 2.0 rc-2 and having a problem adding a request header named 
"Cookie".

Using the following:

   method.addRequestHeader("Cookie", "MOIN_ID=\"...\"");

I don't see a "Cookie" header, combing through the logging output with 
"org.apache.commons.logging.simplelog.log.httpclient.wire"="true".

Using the following:

   method.addRequestHeader("FooHoo", "WooWee");

I do see "FooHoo", so this seems to be specific to "Cookie" unless I'm missing 
something or doing something wrong.

Is this a bug or by design?  I'd like to be able to send a cook value with 
having to deal with policies, etc...

Thanks,
-Ollie

-- 
Ollie Rutherfurd
http://www.rutherfurd.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: addRequestHeader doesn't work for "Cookie"?

Posted by Ollie Rutherfurd <ol...@rutherfurd.net>.
Thanks, Oleg!

-Ollie

Oleg Kalnichevski wrote:

> Ollie,
> That was a conscious design decision. Ideally one should be using
> HttpState#addCoookie method to add cookies to the HTTP state used by
> HttpClient. 
> 
> Lately, however, quite a few people complained about inability to add
> 'Cookie' request headers as a limitation of the existing cookie
> management API. I am planning to provide a patch against CVS HEAD to
> address the problem. It's too late to change the 2.0 branch which is
> already in the final release phase.
> 
> Regards,
> 
> Oleg

[snipped]


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org


Re: addRequestHeader doesn't work for "Cookie"?

Posted by Oleg Kalnichevski <ol...@apache.org>.
Ollie,
That was a conscious design decision. Ideally one should be using
HttpState#addCoookie method to add cookies to the HTTP state used by
HttpClient. 

Lately, however, quite a few people complained about inability to add
'Cookie' request headers as a limitation of the existing cookie
management API. I am planning to provide a patch against CVS HEAD to
address the problem. It's too late to change the 2.0 branch which is
already in the final release phase.

Regards,

Oleg

On Tue, 2003-10-21 at 19:48, Ollie Rutherfurd wrote:
> Hi,
> 
> I'm using HttpClient 2.0 rc-2 and having a problem adding a request header named 
> "Cookie".
> 
> Using the following:
> 
>    method.addRequestHeader("Cookie", "MOIN_ID=\"...\"");
> 
> I don't see a "Cookie" header, combing through the logging output with 
> "org.apache.commons.logging.simplelog.log.httpclient.wire"="true".
> 
> Using the following:
> 
>    method.addRequestHeader("FooHoo", "WooWee");
> 
> I do see "FooHoo", so this seems to be specific to "Cookie" unless I'm missing 
> something or doing something wrong.
> 
> Is this a bug or by design?  I'd like to be able to send a cook value with 
> having to deal with policies, etc...
> 
> Thanks,
> -Ollie


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org