public String getCharsetFromContentType(String defaultCharset) {
        String charset = null;
        String contentTypeStr = headers.get(CONTENT_TYPE);
        if (contentTypeStr != null) {
            charset = new ContentType(contentTypeStr).getCharset();
        }
        return charset != null ? charset : defaultCharset;
    }
Extract the charset from the Content-Type header. When not present, the default charset is returned.

@param defaultCharset the default charset
@return charset
plugins/jsonp-policy/src/main/java/io/apiman/plugins/jsonp_policy/http/HttpHeaders.java