camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryce Ewing <bryc...@gmail.com>
Subject HTTP / HTTP4 issue with accept content / content encoding
Date Wed, 21 Jul 2010 09:44:55 GMT

Hi,

I have had some issues around content encodings, specifically gzipped HTTP
content for an RSS feed.  This is related to:
   
http://camel.465427.n5.nabble.com/Error-with-RSS-component-accessing-gzip-content-td1335918.html#a1543487
but also separate.

When using either HTTP or HTTP4 components to try to solve the issues I was
having for RSS feeds I have found these also don't work in all cases.  It
seems rather strange to me how this is currently setup.

Based on the RFC to let a server at the other end know what content
encodings you accept you send a Accept-Encoding header, e.g. if you only
accept gzip you could send "Accept-Encoding: gzip", if you accept gzip and
identity (i.e. not encoded) then you could send "Accept-Encoding gzip,
identity".  Based on the encodings that you tell the server you accept it
can then choose what to send you in response, and it lets you know this by
setting the Content-Encoding response header.

Where things get a little strange for the http and http4 components is that
they seem to be checking for the Content-Encoding header on the request.  I
initially thought that to perform a request for gzip content the
Content-Encoding header should be set prior to calling the http component,
e.g.:
  from(timerEndPoint)
    .setHeader(Exchange.CONTENT_ENCODING, constant("gzip"))
    .to(httpFeedUrl)
and that maybe it was translated into a Accept-Encoding header.

It seems to me that it would be best to read the response Content-Encoding
header in order to determine whether to decode the stream or not.

Thoughts?

Cheers
Bryce
-- 
View this message in context: http://camel.465427.n5.nabble.com/HTTP-HTTP4-issue-with-accept-content-content-encoding-tp1698061p1698061.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message