public String getStringBody ( ) throws UnsupportedEncodingException { if ( mStringBody != null ) return mStringBody ; if ( mContentType != null ) { switch ( mContentType ) { case JSON : JsonObject jsonBody = new JsonObject ( ) ; for ( Map . Entry < String , Object > entry : mBodyMap . entrySet ( ) ) { parseHashMapEntry ( jsonBody , entry ) ; } mStringBody = jsonBody . toString ( ) ; break ; case URL_ENCODED : HashMap < String , String > stringMap = new HashMap < String , String > ( ) ; for ( Map . Entry < String , Object > entry : mBodyMap . entrySet ( ) ) { stringMap . put ( entry . getKey ( ) , ( String ) entry . getValue ( ) ) ; } mStringBody = createQuery ( stringMap ) ; break ; case JSON_PATCH : mStringBody = ( ( BoxArray ) mBodyMap . get ( JSON_OBJECT ) ) . toJson ( ) ; break ; } } return mStringBody ; }
Gets the string body for the request .