Description
When multipart posting is used, the content type is passed to the constructor for InputStreamBody as a simple string:
parts.add(new FormBodyPart(name, new InputStreamBody( content.getStream(), contentType, content.getName())));
This is incorrect; HttpClient does not parse that contentType as anything other than a mime type and thus blows up when you pass in something like "text/plain; charset=utf-8". The correct code is:
parts.add(new FormBodyPart(name, new InputStreamBody( content.getStream(), ContentType.parse(contentType), content.getName())));
This was discovered by a ManifoldCF user.