hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chad La Joie <laj...@itumi.biz>
Subject Bytes Missing from HTTP Response
Date Fri, 01 Apr 2011 13:06:54 GMT
I'm experiencing an odd problem with HttpClient 4.1.1.  I perform a GET
on a document and then use the following code to get the bytes of the
response entity (assuming a 200 status code):

byte[] responseEntity = EntityUtils.toByteArray(response.getEntity());

The problem I'm having is that this returns 16 fewer bytes than are
actually in the document.  So far I've checked:
 - that downloading the file via wget gives me the expected byte account
 - that the downloaded content is not compressed

The document itself has a digital signature over it and this is failing
to validate with the content as downloaded by HttpClient, but not with
the document downloaded by wget so there is some material difference in
the canonical form of the document (i.e., it's not just a lack of a new
line at the start/end of the document).

Any thoughts?  Is EntityUtils.toByteArray not the right method to use to
get the complete byte[] of the response entity?

Chad La Joie
trusted identities, delivered

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

View raw message