You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jörn Kottmann <ko...@gmail.com> on 2009/06/18 12:50:00 UTC

Camel http: How to disable cookies ?

Hi,

we are using camel http to poll a xml feed,
tough after a few days we get 400 Bad Request replies
from the server.

Analyzing of the network traffic showed that on each
request the http server is setting a new cookie,
after 2 two days our get request is too long and
the apache http server rejects the request with a 400
reply.

The jakarta http client has an option to ignore cookies,
it can be set via setCookiePolicy to the CookiePolicy.IGNORE_COOKIES
constant.

I tried to add httpClient.setCookiePolicy=ignoreCookies or
httpClient.setCookiePolicy=IGNORE_COOKIES to the url
but cookies are still not ignored.

The feed url contains username and password parameters,
to avoid camel http to use these for authentication I use
the HttpProducer.QUERY header field.
The httpClient parameter was added directly to the url and
not to the QUERY header.

How is the cookie policy set correctly to ignore cookies ?

Jörn



Re: Camel http: How to disable cookies ?

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jun 22, 2009 at 11:24 AM, Jörn Kottmann <ko...@gmail.com> wrote:

> Claus Ibsen wrote:
>
>> Hi Jorn
>> Could you verify if this works. Then I would like to add a little bit of
>> documentation to the wiki how to disable cookies.
>>
>>
> Yes, it works thanks.
>
> BTW, I am a committer over at Apache UIMA and there
> we use docbook for our documentation, maybe
> thats also something for camel. The advantage over
> a wiki is that the documentation can be included in
> the distribution and must only be written for one
> particular version.


Yeah the confluence wiki is not good for product documentation at apache.
I would love it was offline as well as part of the source files.

But hey the docs was started in the wiki and now we got stuck with it.
Its currently a too massive task to move to offline like docbook.




>
>
> Jörn
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel http: How to disable cookies ?

Posted by Jörn Kottmann <ko...@gmail.com>.
Claus Ibsen wrote:
> Hi Jorn
> Could you verify if this works. Then I would like to add a little bit of
> documentation to the wiki how to disable cookies.
>   
Yes, it works thanks.

BTW, I am a committer over at Apache UIMA and there
we use docbook for our documentation, maybe
thats also something for camel. The advantage over
a wiki is that the documentation can be included in
the distribution and must only be written for one
particular version.

Jörn

Re: Camel http: How to disable cookies ?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi Jorn
Could you verify if this works. Then I would like to add a little bit of
documentation to the wiki how to disable cookies.




On Sun, Jun 21, 2009 at 4:42 AM, Willem Jiang <wi...@gmail.com>wrote:

> Hi,
>
> Please use this parameter
> httpClient.cookiePolicy=ignoreCookies
>
> Willem
>
> Jörn Kottmann wrote:
> > Hi,
> >
> > we are using camel http to poll a xml feed,
> > tough after a few days we get 400 Bad Request replies
> > from the server.
> >
> > Analyzing of the network traffic showed that on each
> > request the http server is setting a new cookie,
> > after 2 two days our get request is too long and
> > the apache http server rejects the request with a 400
> > reply.
> >
> > The jakarta http client has an option to ignore cookies,
> > it can be set via setCookiePolicy to the CookiePolicy.IGNORE_COOKIES
> > constant.
> >
> > I tried to add httpClient.setCookiePolicy=ignoreCookies or
> > httpClient.setCookiePolicy=IGNORE_COOKIES to the url
> > but cookies are still not ignored.
> >
> > The feed url contains username and password parameters,
> > to avoid camel http to use these for authentication I use
> > the HttpProducer.QUERY header field.
> > The httpClient parameter was added directly to the url and
> > not to the QUERY header.
> >
> > How is the cookie policy set correctly to ignore cookies ?
> >
> > Jörn
> >
> >
> >
>
>


-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Camel http: How to disable cookies ?

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

Please use this parameter
httpClient.cookiePolicy=ignoreCookies

Willem

Jörn Kottmann wrote:
> Hi,
> 
> we are using camel http to poll a xml feed,
> tough after a few days we get 400 Bad Request replies
> from the server.
> 
> Analyzing of the network traffic showed that on each
> request the http server is setting a new cookie,
> after 2 two days our get request is too long and
> the apache http server rejects the request with a 400
> reply.
> 
> The jakarta http client has an option to ignore cookies,
> it can be set via setCookiePolicy to the CookiePolicy.IGNORE_COOKIES
> constant.
> 
> I tried to add httpClient.setCookiePolicy=ignoreCookies or
> httpClient.setCookiePolicy=IGNORE_COOKIES to the url
> but cookies are still not ignored.
> 
> The feed url contains username and password parameters,
> to avoid camel http to use these for authentication I use
> the HttpProducer.QUERY header field.
> The httpClient parameter was added directly to the url and
> not to the QUERY header.
> 
> How is the cookie policy set correctly to ignore cookies ?
> 
> Jörn
> 
> 
>