With this snippet I am creating a MultiPartEntity
with a StringBody
inside. The problem is that the Content-Type and Content-Transfer-Encoding are being set and I cannot find a way to remove them.
MultipartEntityBuilder entity = MultipartEntityBuilder.create();
entity.addPart("filename", new StringBody("restore.zip",
ContentType.DEFAULT_BINARY));
I am obviously adding ContentType.DEFAULT_BINARY
as the Content-Type but even if I do:
entity.addBinaryBody("filename", "restore.zip".getBytes("UTF-8"));
I still get a default Content-Type.
Is there possibly any way to remove these headers inside a body?
Figured it out. The MultipartEntityBuilder
has a method to set the mode used.
entity.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);