hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ham MI-EN Oliver Rennert" <oliver.renn...@kuehne-nagel.com>
Subject Set Content-length in mulitpart headers
Date Tue, 08 Feb 2005 22:01:40 GMT
Hello httpclient users

I am posting files to a server with a MultipartRequestEntity.

The result looks like this:
--FZU0uEJyLTvOZGiw2Wsmm5Bl7a330uHLv5YKIKt
Content-Disposition: form-data; name="prefix"
Content-Type: application/x-www-form-urlencoded; charset=US-ASCII

AppVersion=1.0&AcceptUPSLicenseAgreement=Yes&ResponseType=application/x-ups-pld&
VersionNumber=V4R1&UserId=USER&Password=PASSWORD
--FZU0uEJyLTvOZGiw2Wsmm5Bl7a330uHLv5YKIKt
Content-Disposition: form-data; name="testpld0200.txt";
filename="testpld0200.txt"
Content-Type: application/x-ups-binary; charset=ISO-8859-1

020094                                  2005012700000590210000800
000000001*AA590210
--FZU0uEJyLTvOZGiw2Wsmm5Bl7a330uHLv5YKIKt--


But I also need the client to create a Content-length header for every part.
I browsed already through the source code and noticed that the Content-length
will only be created if the TransferEncoding is null and the content is not
chunked.

For this reason I included the following into my code:
  post.setContentChunked(false);
  stringPart.setTransferEncoding(null);
  filePart.setTransferEncoding(null);


Who knows how to add the ContentLength Header?


Kind Regards,
Oliver Rennert


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


Mime
View raw message