protected void addContentTypeHeader(PortletRequest portletRequest) {
// If the specified portletRequest contains characterSetEncoding and contentType information, then
// use that to build the header.
if (portletRequest instanceof ClientDataRequest) {
ClientDataRequest clientDataRequest = (ClientDataRequest) portletRequest;
String contentType = clientDataRequest.getContentType();
String characterSetEncoding = clientDataRequest.getCharacterEncoding();
StringBuilder header = new StringBuilder();
header.append(HEADER_CONTENT_TYPE);
header.append(StringPool.COLON);
header.append(StringPool.SPACE);