public StringBody(final String text,final String mimeType,Charset charset) throws UnsupportedEncodingException {
  super(mimeType);
  if (text == null) {
    throw new IllegalArgumentException("Text may not be null");
  }
  if (charset == null) {
    charset=Charset.forName(HTTP.UTF_8);
  }
  this.content=text.getBytes(charset.name());
  this.charset=charset;
}

public StringBody ( final String text , final String mimeType , Charset charset ) throws UnsupportedEncodingException { super ( mimeType ) ; if ( text == null ) { throw new IllegalArgumentException ( "Text may not be null" ) ; } if ( charset == null ) { charset = Charset . forName ( HTTP . UTF_8 ) ; } this . content = text . getBytes ( charset . name ( ) ) ; this . charset = charset ; }
create a stringbody from the specified text , mime type and character set .
