protected JSONObject executeForm ( HttpMethod httpMethodParam , List < HeaderNameValue > headerNameValuesParam , boolean checkConnectionValidParam , List < FormNameValue > formNameValuesParam , ContentType contentTypeParam , String postfixUrlParam ) { //Validate Form Field and values... if ( formNameValuesParam == null || formNameValuesParam . isEmpty ( ) ) { throw new FluidClientException ( "No 'Name and Value' body to post." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } StringBuilder strBuilder = new StringBuilder ( ) ; for ( FormNameValue nameValue : formNameValuesParam ) { if ( nameValue . getName ( ) == null || nameValue . getName ( ) . trim ( ) . isEmpty ( ) ) { continue ; } if ( nameValue . getValue ( ) == null ) { continue ; } strBuilder . append ( nameValue . getName ( ) ) ; strBuilder . append ( EQUALS ) ; strBuilder . append ( nameValue . getValue ( ) ) ; strBuilder . append ( AMP ) ; } String bodyJsonString = strBuilder . toString ( ) ; bodyJsonString = bodyJsonString . substring ( 0 , bodyJsonString . length ( ) - 1 ) ; return this . executeString ( httpMethodParam , headerNameValuesParam , checkConnectionValidParam , bodyJsonString , contentTypeParam , postfixUrlParam ) ; }
Submit a HTML Form based HTTP request body with JSON as a response .