// We need to modify the Content-Type header as a result.
String contentTypeString = getContentType();
if (contentTypeString != null) {
ContentType ctype = ContentType.parse(contentTypeString);
if (specified_charset == null) {
ctype.removeParameter("charset");
} else {
ctype.setParameter("charset", specified_charset);
}
setHeader("Content-Type", ctype.toString());
}