// When no length is specified, the HTTP client core forces Transfert-Encoding: chunked
// The code bellow shows a workaround, although we should avoid that
if(false) {
if(length<0) {
ByteStreamCache bs = new ByteStreamCache();
bs.copyFrom(request.getInputStream());
HttpEntity payloadEntity = new InputStreamEntity(bs.getInputStream(), bs.getLength());
((HttpEntityEnclosingRequest) method).setEntity(payloadEntity);
return method;
}
}