hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Royan <romayan...@mail.ru>
Subject HttpClient does not seem to correctly handle chunked response
Date Wed, 20 Jan 2010 16:20:45 GMT

We have an XML API service which splits reply XML data into chunks if it is
larger then certain amount of bytes. Here is the sample piece of the reply:

HTTP/1.1 200 OK
Server: nginx/0.6.35
Date: Wed, 20 Jan 2010 14:53:27 GMT
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA
Connection: close

<?xml version='1.0' encoding='UTF-8'?>
<Label><![CDATA[Some character data br
oken in the middle of the string]]></Label>


The problem is when this XML is retrieved via
httpResponse.getEntity().getContent() I expect all chunks to be transformed
into single XML with no service information (I'm talking about some strange
2000 number appearing in the middle of the string)

In fact returned content is not always correctly parsed and contains such
service information, which in turn makes my XML parser throw an exception

httpResponse.getEntity().isChunked() always retrieves "true"

Can anyone advice on what am I doing wrong or otherwise provide information
how to workaround such issue?

View this message in context: http://old.nabble.com/HttpClient-does-not-seem-to-correctly-handle-chunked-response-tp27244426p27244426.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org

View raw message