public String getBodyStr ( ) { ArrayList < String > arr = new ArrayList < String > ( ) ; if ( bodyFormat . equals ( EBodyFormat . FORM_KV ) ) { for ( Map . Entry < String , Object > entry : body . entrySet ( ) ) { if ( entry . getValue ( ) == null || entry . getValue ( ) . equals ( "" ) ) { arr . add ( Util . uriEncode ( entry . getKey ( ) , true ) ) ; } else { arr . add ( String . format ( "%s=%s" , Util . uriEncode ( entry . getKey ( ) , true ) , Util . uriEncode ( entry . getValue ( ) . toString ( ) , true ) ) ) ; } } return Util . mkString ( arr . iterator ( ) , ' ' ) ; } else if ( bodyFormat . equals ( EBodyFormat . RAW_JSON ) ) { JSONObject json = new JSONObject ( ) ; for ( Map . Entry < String , Object > entry : body . entrySet ( ) ) { json . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } return json . toString ( ) ; } else if ( bodyFormat . equals ( EBodyFormat . RAW_JSON_ARRAY ) ) { return ( String ) body . get ( "body" ) ; } return "" ; }
get body content depending on bodyFormat