public static final HttpEntity fromContent ( Content content , String charset ) { String body ; if ( content instanceof Xml ) { // See https://github.com/playframework/playframework/issues/2770 body = content . body ( ) . trim ( ) ; } else { body = content . body ( ) ; } return new Strict ( ByteString . fromString ( body , charset ) , Optional . of ( content . contentType ( ) + "; charset=" + charset ) ) ; }
Create an entity from the given content .