public static String encodeForPOST(final String str){
  try {
    return Base64.encode(str.getBytes("UTF-8"),true);
  }
 catch (  UnsupportedEncodingException uee) {
    debug.error("SAML2Utils.encodeForPOST",uee);
    return null;
  }
}

public static String encodeForPOST ( final String str ) { try { return Base64 . encode ( str . getBytes ( "UTF-8" ) , true ) ; } catch ( UnsupportedEncodingException uee ) { debug . error ( "SAML2Utils.encodeForPOST" , uee ) ; return null ; } }
returns the encoded request message . the saml request message must be encoded before being transmitted . the request message is base - 64 encoded according to the rules specified in rfc2045 .
